8.7. Configuring SFLOW

Overview

Function Introduction

SFlow is a technology for monitoring traffic in data networks containing switches and routers. In particular, it defines the sampling mechanisms implemented in a sFlow Agent for monitoring traffic, and the format of sample data used by the sFlow Agent when forwarding data to a central data collector.

The architecture and sampling techniques used in the sFlow monitoring system are designed to provide continuous site-wide (and network-wide) traffic monitoring for high speed switched and routed networks.

The sFlow Agent uses two forms of sampling: statistical packet-based sampling of switched flows, and time-based sampling of network interface statistics.

Default Configuration for sFlow:

Feature

Default Setting

global sflow

disabled

sflow on port

disable

collector udp port

6343

counter interval time

20 seconds

Principle Description

N/A

Configuration

image

Fig. 8.8 SFlow

step 1 Enter the configure mode

Switch# configure terminal

step 2 Enable sflow globally

Switch(config)# sflow enable

step 3 Set the global attribute for sflow

Set the agent IP address set the collector IP address and udp port. If the udp port is not specified, it means default port 6364.

Switch(config)# sflow agent ip 3.3.3.1
Switch(config)# sflow collector 3.3.3.2 6342

Set the agent and collector with IPv6:

Switch(config)# sflow agent ipv6 2001:2000::2
Switch(config)# sflow collector 2001:2000::1

image13At list one Agent and one collector must be configured for sflow. User can use IPv4 or IPv6.

Set the interval to send interface counter information (optional):

Switch(config)# sflow counter interval 15

step 4 Enter the interface configure mode and set the attributes of the interfaces

Switch(config)# interface eth-0-1
Switch(config-if)# no switchport
Switch(config-if)# no shutdown
Switch(config-if)# ip address 15.1.1.1/24
Switch(config-if)# exit
Switch(config)# interface eth-0-2
Switch(config-if)# no switchport
Switch(config-if)# no shutdown
Switch(config-if)# ip address 16.1.1.1/24
Switch(config-if)# exit
Switch(config)# interface eth-0-3
Switch(config-if)# no switchport
Switch(config-if)# no shutdown
Switch(config-if)# ip address 3.3.3.1/24
Switch(config-if)# exit

step 5 Enable sflow for input packets on eth-0-1

Switch(config)# interface eth-0-1
Switch(config-if)# sflow flow-sampling rate 8192
Switch(config-if)# sflow flow-sampling enable input
Switch(config-if)# sflow counter-sampling enable
Switch(config-if)# exit

step 6 Validation

To display the sflow configuration, use following command

Switch# show sflow
sFlow Version: 5
sFlow Global Information:
Agent IPv4 address : 3.3.3.1
Agent IPv6 address : 2001:1000::2
Counter Sampling Interval : 15 seconds
Collector 1:
IPv4 Address: 3.3.3.2
vrf: N/A
Port: 6342
Collector 2:
IPv6 Address: 2001:1000::1
vrf: N/A
Port: 6343
sFlow Port Information:
Flow-Sample Flow-Sample
Port Counter Flow Direction Rate
 -------------------------------------------------------
eth-0-1 Enable Enable Input 8192

Application cases

N/A