Configure sFlow for Multiple Collectors
Overview
The sFlow feature collects sampled traffic data and counters from configured interfaces. The collected data is sent to a collector using the sFlow protocol. For more information, refer to
https://datatracker.ietf.org/doc/html/rfc3176.This functionality is enhanced to support multiple collectors with one connections for each, simultaneously.
Feature Characteristics
• Supports maximum of five concurrent sFlow collectors on the system.
• Uses a specific user defined VRF interface for each collector. If not specified, the management VRF is used.
• Sends the collected sFlow samples on each interface to the corresponding collector configured on the interface.
Benefits
The sFlow with multiple collectors support provides the capability to do multiple analysis simultaneous in a network.
Prerequisites
Make sure to enable the required interface with sflow data collection and a agent IP address. For example,
feature sflow
sflow agent-ip 1.2.7.10
Configuration
This section provides the configurations required to assign multiple sFlow collectors to OcNOS.
Topology
The following topology illustrates the sFlow multiple collectors connected with one sFlow Packet Data Unit (PDU):
sFlow with Multiple Collectors
Perform the following configurations:
2. In the interface mode, enable sFlow for a particular interface and specify the collector-id for multiple collectors:
OcNOS(config)#interface xe12
OcNOS(config-if)#sflow sampling-rate 1024 direction ingress max-header-size 256
OcNOS(config-if)#sflow sampling-rate 2000 direction egress max-header-size 16
OcNOS(config-if)#sflow enable
OcNOS(config-if)#sflow poll-interval 10
OcNOS(config-if)#sflow collector-id 3
Show Running Configurations
The following show output display the sample sflow configuration details.
OcNOS#show running-config sflow feature sflow
sflow agent-ip 1.2.7.10
sflow collector-id 3 collector 1.2.3.24 port 6345 receiver-time-out 5 max-datagram-size 1560
sflow collector-id 4 collector 1.2.4.24 port 6346 receiver-time-out 4 max-datagram-size 1570 vrf default
1570 vrf default
!
interface xe12
sflow sampling-rate 1024 direction ingress max-header-size 256
sflow sampling-rate 2000 direction egress max-header-size 16 sflow enable
sflow poll-interval 10
sflow collector-id 3
!
interface xe13
sflow sampling-rate 2500 direction ingress max-header-size 100
sflow sampling-rate 2000 direction egress max-header-size 16
sflow enable
sflow poll-interval 5
sflow collector-id 4
!
Validation
The following show output displays the sFlow details:
OcNOS#show sflow detail
sFlow Feature: Enabled
sFlow Version: 5
Agent IP : 1.2.7.10
Collector 3:
IP: 1.2.3.24 Port: 6345
VRF :
Maximum Datagram Size(bytes): 1560
Receiver timeout(sec) : 0
Collector 4:
IP: 1.2.4.24 Port: 6346
VRF :
Maximum Datagram Size(bytes): 1570
Receiver timeout(sec) : 0
sFlow Port Detailed Information:
Interface Collector Packet-Sampling Packet-Sampling Counter-Polling Maximum Header
ID Rate Count Interval Count Size(bytes)
Ingress Egress Ingress Egress (sec) Ingress Egress
--------- --------- ----------------------- ----------------------- ----------------------- --------------------
Xe12 3 1024 2000 3 6 10 0 256 16
Xe13 4 2500 2000 4 7 5 3 100 16
CLI Commands
The sFlow feature introduces the following configuration command.
sflow collector-id
Use this command to configure the collector id which receives sFlow data collected from the interface.
Command Syntax
sflow collector-id <1-5>|
Parameter
collector-id <1-5> | Specifies the name of the Collector instance identifier. If the collector-id is not specified, the ID will be 1. |
Default
Disabled.
Command Mode
Interface mode
Applicability
This command was introduced in OcNOS version 6.5.1.
Example
OcNOS(config)#interface xe12
OcNOS(config-if)#sflow sampling-rate 1024 direction ingress max-header-size 256
OcNOS(config-if)#sflow enable
OcNOS(config-if)#sflow poll-interval 10
OcNOS(config-if)#sflow collector-id 3
For additional information about the revised
sflow collector command, refer to the
sFlow Commands section.
Glossary
Key Terms/Acronym | Description |
PDU | A unit of data transmitted as a composite by a protocol. |
sFlow | Sampled Flow data 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. |