Configuring sFLOW - cisco.com · Configuring sFLOW Thischaptercontainsthefollowingsections: •...
Transcript of Configuring sFLOW - cisco.com · Configuring sFLOW Thischaptercontainsthefollowingsections: •...
Configuring sFLOW
This chapter contains the following sections:
• Information About sFlow, page 1
• Licensing Requirements, page 2
• Prerequisites, page 2
• Guidelines and Limitations for sFlow, page 2
• Default Settings for sFlow, page 2
• Configuring sFLow, page 3
• sFLOW Show Commands, page 9
• Configuration Examples for sFlow, page 9
• Additional References for sFlow, page 10
• Feature History for sFlow, page 10
Information About sFlowsFlow allows you to monitor the real-time traffic in data networks that contain switches and routers. It usesthe sampling mechanism in the sFlow Agent software on switches and routers for monitoring traffic and toforward the sample data on ingress and egress ports to the central data collector, also called the sFlowAnalyzer.
For more information about sFlow, see RFC 3176.
sFlow AgentThe sFlowAgent, which is embedded in the Cisco NX-OS software, periodically samples or polls the interfacecounters that are associated with a data source of the sampled packets. The data source can be an Ethernetinterface, an EtherChannel interface, or a range of Ethernet interfaces. The sFlow Agent queries the Ethernetport manager for the respective EtherChannel membership information and also receives notifications fromthe Ethernet port manager for membership changes.
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U5(1) OL-26558-03 1
When you enable sFlow sampling in the Cisco NX-OS software, based on the sampling rate and the hardwareinternal random number, the ingress packets and egress packets are sent to the CPU as an sFlow-sampledpacket. 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 RequirementsThis feature does not require a license. Any feature not included in a license package is bundled with the CiscoNX-OS system images and is provided at no extra charge to you. For a complete explanation of the CiscoNX-OS licensing scheme, see the Cisco NX-OS Licensing Guide.
PrerequisitesYou must enable the sFlow feature using the feature sflow command to configure sFlow.
Guidelines and Limitations for sFlowWhen 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 enablesFlow 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 sFlowTable 1: Default sFlow Parameters
DefaultParameters
4096sFlow sampling-rate
128sFlow sampling-size
1400sFlow max datagram-size
6343sFlow collector-port
20sFlow counter-poll-interval
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U5(1)2 OL-26558-03
Configuring sFLOWLicensing Requirements
Configuring sFLow
Enabling the sFlow FeatureYou must enable the sFlow feature before you can configure sFlow on the switch.
Procedure
PurposeCommand or Action
Enters global configuration mode.switch# configure terminalStep 1
Enables the sFlow feature.[no] feature sflowStep 2
(Optional)Displays enabled and disabled features.
show featureStep 3
(Optional)Saves the change persistently through reboots andrestarts by copying the running configuration to thestartup configuration.
switch(config)# copy running-configstartup-config
Step 4
This example shows how to enable the sFlow feature:switch# configure terminalswitch(config)# feature sflowswitch(config)# copy running-config startup-config
Configuring the Sampling Rate
Before You Begin
Ensure that you have enabled the sFlow feature.
Procedure
PurposeCommand or Action
Enters global configuration mode.switch# configure terminalStep 1
Configures the sFlow sampling rate for packets.[no] sflow sampling-ratesampling-rate
Step 2
The sampling-rate can be an integer between4096-1000000000. The default value is 4096.
A sampling-rate of 0 disablessampling.
Note
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U5(1) OL-26558-03 3
Configuring sFLOWConfiguring sFLow
PurposeCommand or Action
(Optional)Displays sFlow information.
show sflowStep 3
(Optional)Saves the change persistently through reboots and restartsby copying the running configuration to the startupconfiguration.
switch(config)# copyrunning-config startup-config
Step 4
This example shows how to set the sampling rate to 50,000:switch# configure terminalswitch(config)# sflow sampling-rate 50000switch(config)# copy running-config startup-config
Configuring the Maximum Sampled SizeYou can configure the maximum number of bytes that should be copied from a sampled packet.
Before You Begin
Ensure that you have enabled the sFlow feature.
Procedure
PurposeCommand or Action
Enters global configuration mode.switch# configure terminalStep 1
Configures the sFlow maximum sampling size packets.[no] sflow max-sampled-sizesampling-size
Step 2
The range for the sampling-size is from 64 to 256 bytes.The default value is 128.
(Optional)Displays sFlow information.
show sflowStep 3
(Optional)Saves the change persistently through reboots and restartsby copying the running configuration to the startupconfiguration.
switch(config)# copyrunning-config startup-config
Step 4
This example shows how to configure the maximum sampling size for the sFlow Agent:switch# configure terminalswitch(config)# sflow max-sampled-size 200switch(config)# copy running-config startup-config
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U5(1)4 OL-26558-03
Configuring sFLOWConfiguring the Maximum Sampled Size
Configuring the Counter Poll IntervalYou can configure the maximum number of seconds between successive samples of the counters that areassociated with the data source. A sampling interval of 0 disables counter sampling.
Before You Begin
Ensure that you have enabled the sFlow feature.
Procedure
PurposeCommand or Action
Enters global configuration mode.switch# configure terminalStep 1
Configures the sFlow poll interval for an interface. Therange for the poll-interval is from 0 to 2147483647seconds. The default value is 20.
[no] sflow counter-poll-intervalpoll-interval
Step 2
(Optional)Displays sFlow information.
show sflowStep 3
(Optional)Saves the change persistently through reboots and restartsby copying the running configuration to the startupconfiguration.
switch(config)# copyrunning-config startup-config
Step 4
This example shows how to configure the sFlow poll interval for an interface:switch# configure terminalswitch(config)# sflow counter-poll-interval 100switch(config)# copy running-config startup-config
Configuring the Maximum Datagram SizeYou can configure the maximum number of data bytes that can be sent in a single sample datagram.
Before You Begin
Ensure that you have enabled the sFlow feature.
Procedure
PurposeCommand or Action
Enters global configuration mode.switch# configure terminalStep 1
Configures the sFlow maximum datagram size.[no] sflow max-datagram-sizedatagram-size
Step 2
The range for the datagram-size is from 200 to 9000bytes. The default value is 1400.
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U5(1) OL-26558-03 5
Configuring sFLOWConfiguring the Counter Poll Interval
PurposeCommand or Action
(Optional)Displays sFlow information.
show sflowStep 3
(Optional)Saves the change persistently through reboots andrestarts by copying the running configuration to thestartup configuration.
switch(config)# copyrunning-config startup-config
Step 4
This example shows how to configure the sFlow maximum datagram size:switch# configure terminalswitch(config)# sflow max-datagram-size 2000switch(config)# copy running-config startup-config[########################################] 100%
Configuring the sFlow Analyzer Address
Before You Begin
Ensure that you have enabled the sFlow feature.
Procedure
PurposeCommand or Action
Enters global configuration mode.switch# configure terminalStep 1
Configures the IPv4 address for the sFlow Analyzer.[no] sflow collector-ipIP-address vrf-instance
Step 2
vrf-instance can be one of the following:
• A user-defined VRF name. You can specify a maximumof 32 alphanumeric characters.
• vrf management. You must use this option if the sFlowdata collector is on the network connected to themanagement port.
• vrf default. You must use this option if the sFlow datacollector is on the network connected to the front panelports.
(Optional)Displays sFlow information.
show sflowStep 3
(Optional)Saves the change persistently through reboots and restarts bycopying the running configuration to the startup configuration.
switch(config)# copyrunning-config startup-config
Step 4
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U5(1)6 OL-26558-03
Configuring sFLOWConfiguring the sFlow Analyzer Address
This example shows how to configure the IPv4 address of the sFlow data collector that is connected to themanagement port:switch# configure terminalswitch(config)# sflow collector-ip 192.0.2.5 vrf managementswitch(config)# copy running-config startup-config
Configuring the sFlow Analyzer PortYou can configure the destination port for sFlow datagrams.
Before You Begin
Ensure that you have enabled the sFlow feature.
Procedure
PurposeCommand or Action
Enters global configuration mode.switch# configure terminalStep 1
Configures the UDP port of the sFlow Analyzer.[no] sflow collector-portcollector-port
Step 2
The range for the collector-port is from 0 to 65535. Thedefault value is 6343.
(Optional)Displays sFlow information.
show sflowStep 3
(Optional)Saves the change persistently through reboots andrestarts by copying the running configuration to thestartup configuration.
switch(config)# copyrunning-config startup-config
Step 4
This example shows how to configure the destination port for sFlow datagrams:switch# configure terminalswitch(config)# sflow collector-port 7000switch(config)# copy running-config startup-config[########################################] 100%switch(config)#
Configuring the sFlow Agent Address
Before You Begin
Ensure that you have enabled the sFlow feature.
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U5(1) OL-26558-03 7
Configuring sFLOWConfiguring the sFlow Analyzer Port
Procedure
PurposeCommand or Action
Enters global configuration mode.switch# configure terminalStep 1
Configures the IPv4 address of the sFlow Agent.[no] sflow agent-ip ip-addressStep 2
The default ip-address is 0.0.0.0, which means that allsampling is disabled on the switch. Youmust specify a validIP address to enable sFlow functionality.
(Optional)Displays sFlow information.
show sflowStep 3
(Optional)Saves the change persistently through reboots and restartsby copying the running configuration to the startupconfiguration.
switch(config)# copyrunning-config startup-config
Step 4
This example shows how to configure the IPv4 address of the sFlow Agent:switch# configure terminalswitch(config)# sflow agent-ip 192.0.2.3switch(config)# copy running-config startup-config
Configuring the sFlow Sampling Data SourceThe sFlow sampling data source can be an Ethernet port, a range of Ethernet ports, or a port channel.
Before You Begin
• Ensure that you have enabled the sFlow feature.
• If you want to use a port channel as the data source, ensure that you have already configured the portchannel and you know the port channel number.
Procedure
PurposeCommand or Action
Enters global configuration mode.switch# configure terminalStep 1
Configures the sFlow sampling data source.switch(config)# [no] sflow data-sourceinterface [ethernet slot/port[-port]|port-channel channel-number]
Step 2
For an Ethernet data source, slot is the slot numberand port can be either a single port number or a rangeof ports designated as port-port.
(Optional)Displays sFlow information.
switch(config)# show sflowStep 3
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U5(1)8 OL-26558-03
Configuring sFLOWConfiguring the sFlow Sampling Data Source
PurposeCommand or Action
(Optional)Saves the change persistently through reboots andrestarts by copying the running configuration to thestartup configuration.
switch(config)# copy running-configstartup-config
Step 4
This example shows how to configure Ethernet ports 5 through 12 for the sFlow sampler:switch# configure terminalswitch(config)# sflow data-source interface ethernet 1/5-12switch(config)# copy running-config startup-config[########################################] 100%switch(config)#
This example shows how to configure port channel 100 for the sFlow sampler:switch# configure terminalswitch(config)# sflow data-source interface port-channel 100switch(config)# copy running-config startup-config[########################################] 100%switch(config)#
sFLOW Show CommandsTo display the sFlow configuration information, perform one of the following tasks:
PurposeCommand
Displays the sFlow global configuration.show sflow
Displays the sFlow statistics.show sflow statistics
Clears the sFlow statistics.clear sflow statistics
Displays the current running sFlow configuration.show running-config sflow [all]
Configuration Examples for sFlowThis example shows how to configure sFlow:feature sflowsflow sampling-rate 5000sflow max-sampled-size 200sflow counter-poll-interval 100sflow max-datagram-size 2000sflow collector-ip 192.0.2.5 vrf managementsflow collector-port 7000sflow agent-ip 192.0.2.3sflow data-source interface ethernet 1/5
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U5(1) OL-26558-03 9
Configuring sFLOWsFLOW Show Commands
Additional References for sFlowTable 2: Related Documents for sFlow
Document TitleRelated Topic
Cisco Nexus 3000 Series NX-OS SystemManagementCommand Reference.
sFlow CLI commands
Defines the sFlow packet format and SNMP MIB.
http://www.sflow.org/rfc3176.txt
RFC 3176
Feature History for sFlowThis table includes only the updates for those releases that have resulted in additions or changes to the feature.
Feature InformationReleasesFeature Name
This feature was introduced.5.0(3)U4(1)sFlow
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U5(1)10 OL-26558-03
Configuring sFLOWAdditional References for sFlow