- Preface
- New and Changed Information for this Release
- Overview
- Using Cisco Fabric Services
- Configuring PTP
- Configuring User Accounts and RBAC
- Configuring Session Manager
- Configuring the Scheduler
- Configuring Online Diagnostics
- Configuring the Embedded Event Manager
- Configuring System Message Logging
- Configuring Smart Call Home
- Configuring DNS
- Configuring SNMP
- Configuring RMON
- Configuring SPAN
- Configuring ERSPAN
- Configuring sFLOW
- Index
Contents
- Configuring sFLOW
- Information About sFlow
- sFlow Agent
- Licensing Requirements
- Prerequisites
- Guidelines and Limitations for sFlow
- Default Settings for sFlow
- Configuring sFLow
- Enabling the sFlow Feature
- Configuring the Sampling Rate
- Configuring the Maximum Sampled Size
- Configuring the Counter Poll Interval
- Configuring the Maximum Datagram Size
- Configuring the sFlow Analyzer Address
- Configuring the sFlow Analyzer Port
- Configuring the sFlow Agent Address
- Configuring the sFlow Sampling Data Source
- sFLOW Show Commands
- Configuration Examples for sFlow
- Additional References for sFlow
- Feature History for sFlow
Configuring sFLOW
This chapter contains the following sections:
- Information About sFlow
- Licensing Requirements
- Prerequisites
- Guidelines and Limitations for sFlow
- Default Settings for sFlow
- Configuring sFLow
- sFLOW Show Commands
- Configuration Examples for sFlow
- Additional References for sFlow
- Feature History for sFlow
Information About sFlow
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.
For more information about sFlow, see RFC 3176.
sFlow Agent
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
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.
This example shows how to enable the sFlow feature:
switch# configure terminal switch(config)# feature sflow switch(config)# copy running-config startup-config
Configuring the Sampling Rate
Ensure that you have enabled the sFlow feature.
This example shows how to set the sampling rate to 50,000:
switch# configure terminal switch(config)# sflow sampling-rate 50000 switch(config)# copy running-config startup-config
Configuring the Maximum Sampled Size
You can configure the maximum number of bytes that should be copied from a sampled packet.
Ensure that you have enabled the sFlow feature.
Command or Action | Purpose | |
---|---|---|
Step 1 | switch# configure terminal |
Enters global configuration mode. |
Step 2 | [no] sflow max-sampled-size sampling-size | Configures the sFlow maximum sampling size packets. The range for the sampling-size is from 64 to 256 bytes. The default value is 128. |
Step 3 | show sflow | (Optional) Displays sFlow information. |
Step 4 | switch(config)# copy running-config startup-config | (Optional)
Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration. |
This example shows how to configure the maximum sampling size for the sFlow Agent:
switch# configure terminal switch(config)# sflow max-sampled-size 200 switch(config)# copy running-config startup-config
Configuring the Counter Poll Interval
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.
Ensure that you have enabled the sFlow feature.
Command or Action | Purpose | |
---|---|---|
Step 1 | switch# configure terminal |
Enters global configuration mode. |
Step 2 | [no] sflow counter-poll-interval poll-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. |
Step 3 | show sflow | (Optional) Displays sFlow information. |
Step 4 | switch(config)# copy running-config startup-config | (Optional)
Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration. |
This example shows how to configure the sFlow poll interval for an interface:
switch# configure terminal switch(config)# sflow counter-poll-interval 100 switch(config)# copy running-config startup-config
Configuring the Maximum Datagram Size
You can configure the maximum number of data bytes that can be sent in a single sample datagram.
Ensure that you have enabled the sFlow feature.
Command or Action | Purpose | |
---|---|---|
Step 1 | switch# configure terminal |
Enters global configuration mode. |
Step 2 | [no] sflow max-datagram-size datagram-size | Configures the sFlow maximum datagram size. The range for the datagram-size is from 200 to 9000 bytes. The default value is 1400. |
Step 3 | show sflow | (Optional) Displays sFlow information. |
Step 4 | switch(config)# copy running-config startup-config | (Optional)
Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration. |
This example shows how to configure the sFlow maximum datagram size:
switch# configure terminal switch(config)# sflow max-datagram-size 2000 switch(config)# copy running-config startup-config [########################################] 100%
Configuring the sFlow Analyzer Address
Ensure that you have enabled the sFlow feature.
Command or Action | Purpose | |
---|---|---|
Step 1 | switch# configure terminal |
Enters global configuration mode. |
Step 2 | [no] sflow collector-ip IP-address vrf-instance | Configures the IPv4 address for the sFlow Analyzer. vrf-instance can be one of the following:
|
Step 3 | show sflow | (Optional) Displays sFlow information. |
Step 4 | switch(config)# copy running-config startup-config | (Optional)
Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration. |
This example shows how to configure the IPv4 address of the sFlow data collector that is connected to the management port:
switch# configure terminal switch(config)# sflow collector-ip 192.0.2.5 vrf management switch(config)# copy running-config startup-config
Configuring the sFlow Analyzer Port
You can configure the destination port for sFlow datagrams.
Ensure that you have enabled the sFlow feature.
Command or Action | Purpose | |
---|---|---|
Step 1 | switch# configure terminal |
Enters global configuration mode. |
Step 2 | [no] sflow collector-port collector-port | Configures the UDP port of the sFlow Analyzer. The range for the collector-port is from 0 to 65535. The default value is 6343. |
Step 3 | show sflow | (Optional) Displays sFlow information. |
Step 4 | switch(config)# copy running-config startup-config | (Optional)
Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration. |
This example shows how to configure the destination port for sFlow datagrams:
switch# configure terminal switch(config)# sflow collector-port 7000 switch(config)# copy running-config startup-config [########################################] 100% switch(config)#
Configuring the sFlow Agent Address
Ensure that you have enabled the sFlow feature.
Command or Action | Purpose | |
---|---|---|
Step 1 | switch# configure terminal |
Enters global configuration mode. |
Step 2 | [no] sflow agent-ip ip-address | Configures the IPv4 address of the sFlow Agent. 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. |
Step 3 | show sflow | (Optional) Displays sFlow information. |
Step 4 | switch(config)# copy running-config startup-config | (Optional)
Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration. |
This example shows how to configure the IPv4 address of the sFlow Agent:
switch# configure terminal switch(config)# sflow agent-ip 192.0.2.3 switch(config)# copy running-config startup-config
Configuring the sFlow Sampling Data Source
The sFlow sampling data source can be an Ethernet port, a range of Ethernet ports, or a port channel.
Command or Action | Purpose | |
---|---|---|
Step 1 | switch# configure terminal |
Enters global configuration mode. |
Step 2 | switch(config)# [no] sflow data-source interface [ethernet slot/port[-port] |port-channel channel-number] | Configures the sFlow sampling data source. For an Ethernet data source, slot is the slot number and port can be either a single port number or a range of ports designated as port-port. |
Step 3 | switch(config)# show sflow | (Optional) Displays sFlow information. |
Step 4 | switch(config)# copy running-config startup-config | (Optional)
Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration. |
This example shows how to configure Ethernet ports 5 through 12 for the sFlow sampler:
switch# configure terminal switch(config)# sflow data-source interface ethernet 1/5-12 switch(config)# copy running-config startup-config [########################################] 100% switch(config)#
This example shows how to configure port channel 100 for the sFlow sampler:
switch# configure terminal switch(config)# sflow data-source interface port-channel 100 switch(config)# copy running-config startup-config [########################################] 100% switch(config)#
sFLOW Show Commands
To display the sFlow configuration information, perform one of the following tasks:
Command | Purpose |
---|---|
show sflow |
Displays the sFlow global configuration. |
show sflow statistics |
Displays the sFlow statistics. |
clear sflow statistics |
Clears the sFlow statistics. |
show running-config sflow [all] |
Displays the current running sFlow configuration. |
Configuration Examples for sFlow
This example shows how to configure sFlow:
feature sflow sflow sampling-rate 5000 sflow max-sampled-size 200 sflow counter-poll-interval 100 sflow max-datagram-size 2000 sflow collector-ip 192.0.2.5 vrf management sflow collector-port 7000 sflow agent-ip 192.0.2.3 sflow data-source interface ethernet 1/5
Additional References for sFlow
Related Topic | Document Title |
---|---|
sFlow CLI commands |
Cisco Nexus 3000 Series NX-OS System Management Command Reference. |
RFC 3176 |
Defines the sFlow packet format and SNMP MIB. http://www.sflow.org/rfc3176.txt |
Feature History for sFlow
This table includes only the updates for those releases that have resulted in additions or changes to the feature.
Feature Name | Releases | Feature Information |
---|---|---|
sFlow |
5.0(3)U4(1) |
This feature was introduced. |