Configure sFlow for Single Collector

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.

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.

Features

Enable the sFlow feature and collector before enabling sFlow sampling on an interface.

sFlow sampling monitoring cannot be enabled globally across all interfaces with a single command. Instead, it must be configured individually on each desired interface.

The sFlow feature is supported on both physical interfaces and LAG (Link Aggregation Group) interfaces. When sampling is configured on a LAG interface, it is automatically applied to all member ports within that LAG.

When sflow sampling is in-progress on high rate, CPU usage spike messages from Chassis monitoring module (cmmd) is expected.

The Qumran 1 platform is equipped to handle a total of 9 unique sampling rates. Ingress and egress sampling rate is counted separately.

The Qumran 2 platform is equipped to handle a total of 15 unique sampling rates.

  • For egress, maximum 7 unique sampling rates can be created.
  • If egress sampling is not used, a total of 15 unique ingress sampling rates can be configured.
  • Total ingress sampling = 15 - number of egress sampling rates.

Topology

Figure 84. 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 direction ingress

Enter into the sub-menu of sflow direction ingress configuration mode.

(config-if-sflow)#sampling-rate 1024

Set sFlow sampling rate on on xe1 interface.

(config-if-sflow)#max-header-size 200

Set sFlow max header size for sampled packet.

(config-if-sflow)#exit

Exit from the sFlow configuration mode.

(config-if)#sflow direction egress

Enter into the sub-menu of sflow direction egress configuration mode.

(config-if-sflow)#sampling-rate 1024

Set sFlow sampling rate on on xe1 interface.

(config-if-sflow)#max-header-size 120

Set sFlow max header size for sampled packet.

(config-if-sflow)#exit

Exit from the sFlow configuration mode.

(config-if)#sflow enable

Start packet sampling on the interface

(config-if)#commit

Commit the candidate configuration to the running configuration

(config-if)#end

Exit interface and configure mode.

Validation

Copy
#show sflow detail
sFlow Feature: Enabled
sFlow Version: 5
sFlow Global Information :
Agent     IP: 10.10.26.132
Collector IP: 2.2.2.2    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     120          20