OcNOS DC : System Management Guide : System Management Configuration Guide : sFlow Configuration
sFlow Configuration
Overview
This chapter provides the steps for configuring Sampled Flow (sFlow).
sFlow is the standard for monitoring high-speed switched and routed networks. The sFlow monitoring system consists of an sFlow Agent which is embedded in a switch or router and an sFlow Collector.
The sFlow agent samples packets as well as polling traffic statistics for the device it is monitoring. The packet sampling is performed by the switching/routing device at wire speed. The sFlow agent forwards the sampled traffic statistics in sFlow PDUs as well as sampled packets to an sFlow collector for analysis.
Note: sFlow egress sampling for multicast, broadcast, or unknown unicast packets is not supported.
The sFlow agent uses the following forms of sampling:
Sampling packets: samples one packet out of a defined sampling rate. This sampling is done by hardware at wire speed.
Sampling counters: polls interface statistics such as generic and Ethernet counters at a defined interval.
You must enable the sFlow feature and collector before enabling sFlow sampling on an interface.
You cannot globally enable sFlow sampling monitoring on all interfaces with a single command. Instead you must enable sFlow sampling on the required interfaces individually.
sFlow feature is supported on physical interface as well as LAG interface. Configuring sampling on a LAG interface will enable the same on all member ports part of that LAG interface.
Topology
Basic sFlow topology
Configuration
sFlow Agent
 
#configure terminal
Enter configure mode.
(config)#feature sflow
Enable the sFlow feature.
(config)#sflow collector 2.2.2.2 port 6343 receiver-time-out 0 max-datagram-size 200
Configure the sFlow collector. The IP address must be reachable via the management VRF.
(config)#interface xe1
Enter interface mode
(config-if)#sflow poll-interval 5
Set the counter poll Interval on the interface.
(config-if)#sflow sampling-rate 1024 direction ingress max-header-size 200
Set the sFlow sampling interval on the interface in ingress directions.
(config-if)#sflow sampling-rate 1024 direction egress max-header-size 200
Set the sFlow sampling interval on the interface in egress directions.
(config-if)#sflow enable
Start packet sampling on the interface
(config-if)#end
Exit interface and configure mode.
Validation
OcNOS#show sflow detail
sFlow Feature: Enabled
sFlow Version: 5
sFlow Global Information :
Agent IP: 10.10.26.132
Collector IP: 10.156.159.29 Port: 6343
Maximum Datagram Size(bytes): 200
Receiver timeout(sec) : 0
 
sFlow Port Detailed Information:
Interface Packet-Sampling Packet-Sampling Counter-Polling Maximum Header
Rate Count Interval Count Size(bytes)
Ingress Egress Ingress Egress (sec) Ingress Egress
--------- ----------------------- ----------------------- ----------------------- --------------------
xe1/1 1024 1024 464564 414532 5 131 200 20