sFlow
sFlow
1. Function Overview
sFlow is technology for monitoring traffic.
Rather than monitoring all packets in traffic flow, sFlow can monitor traffic information statistically based on sampling only a specific percent of packets.
sFlow monitoring is configured with sFlow agents and sFlow collectors.
-
sFlow agent
-
Monitors traffic by sampling and creates sFlow information.
-
Sends sFlow datagrams, which store sFlow information, to the sFlow collector.
-
-
sFlow collector
-
Receives sFlow datagrams, which store sFlow information, sent from the sFlow agent.
-
Collects and analyzes the sFlow information from datagrams indicated above.
-
sFlow agents can perform two types of sFlow sampling.
Either one or both of the following types of information is stored in sFlow datagrams.
-
Packet flow sampling
-
This samples a specified percent of packets sent and received at the interface.
-
-
Counter sampling
-
This samples data from the interface counter at regular intervals.
-
This product functions as an sFlow agent.
The sFlow collector must be supplied separately.
This product is compatible with sFlow Version 5 (https://sflow.org/sflow_version_5.txt).
2. Definition of Terms Used
sFlow agent
After monitoring traffic by sampling and creating sFlow information, the sFlow agent sends the sFlow information to an sFlow collector.
This product functions as an sFlow agent.
sFlow collector
The sFlow collector collects and analyzes the sFlow information received from sFlow agents.
Packet flow sampling
This sampling method samples a specific percent of the total packets sent and received at the interface.
Counter sampling
This sampling method obtains interface counter values at regular intervals.
sFlow datagram
sFlow datagrams are UDP packets that store the information sFlow agents obtain by sampling.
They are sent from sFlow agents to sFlow collectors.
3. Function Details
The operating specifications for sFlow functionality are indicated below.
-
Use the sflow enable command to enable sFlow functionality.
-
The default setting is sflow disable (disabled).
-
-
Use the sflow agent command to specify the following sFlow agent settings.
-
IP address
-
IPv4 address
-
IPv6 address
-
-
The IP address specified using this command is used in the sFlow header of sFlow datagrams.
-
No setting is specified in default settings.
-
-
Use the sflow collector command to specify the following sFlow collector settings.
-
IP address
-
IPv4 address
-
IPv6 address
-
-
UDP port number
-
The default value is 6343.
-
-
sFlow datagrams are sent to the IP address and UDP port number specified using this command.
-
No setting is specified in default settings.
-
Only one sFlow collector can be specified for this product.
-
Sampling is not started unless this command is specified.
-
-
Packet flow sampling operations are described below.
-
The sflow sampling-rate command is used to specify the sampling rate at physical ports and sample packet flow at the corresponding ports.
-
No setting is specified in default settings.
-
-
The sampling rate is specified as the number of packets from which one packet is sampled.
-
For example, for a sampling rate setting of 1000, one packet is sampled from each 1000 packets that are sent or received at the corresponding port.
-
-
Sent and received packets are sampled separately.
-
Packets are individually sampled at each port.
-
Use the sflow max-header-size command to specify the maximum header size value for Ethernet frames being sampled during packet flow sampling.
-
The default value is 128.
-
-
Specifying the sampling rate using the sflow sampling-rate command results in the following actions.
-
The new sampling rate will be applied after sampling at the previous sampling rate setting is finished.
-
-
-
Counter sampling actions are described below.
-
If the sflow polling-interval command is used to specify the polling interval for a physical port, counter sampling is performed at that port.
-
No setting is specified in default settings.
-
-
The polling interval setting specifies the number of seconds between counter sampling.
-
For example, if a polling interval value of 30 is specified, counter information for the corresponding port is sampled once every 30 seconds.
-
-
Packets are individually sampled at each port.
-
-
This product sends the following types of sFlow datagrams.
-
Use the sflow collector max-datagram-size command to specify the maximum sFlow datagram size.
-
sFlow datagrams from packet flow sampling store the following information for sFlow version 5.
-
Raw Packet Header(enterprise = 0, format = 1)
-
-
sFlow datagrams from counter sampling store the following information for sFlow version 5.
-
Generic Interface Counters(enterprise = 0, format = 1)
-
Ethernet Interface Counters(enterprise = 0, format = 2)
-
Disabled counters include a maximum counter value. (For 32-bit counters, sFlow datagrams store the “0xFFFFFFFF” value.)
-
-
4. Related Commands
Related commands are indicated below.
For details on the commands, refer to the Command Reference.
Operations | Operating commands |
---|---|
Enables sFlow functionality |
sflow |
Sets sFlow agents |
sflow agent |
Sets sFlow collectors |
sflow collector |
Sets the maximum sFlow datagram size |
sflow collector max-datagram-size |
Sets the sampling rate for packet flow sampling |
sflow sampling-rate |
Sets the maximum Ethernet frame header size for packet flow sampling |
sflow max-header-size |
Sets the polling interval for counter sampling |
sflow polling-interval |
Displays the sFlow status |
show sflow |
Displays the sFlow sampling information |
show sflow sampling |
5. Examples of Command Execution
The following samples packets by sFlow packet flow sampling and counter sampling at port 1.1.
-
Set the IP address for the sFlow agent.
Yamaha(config)#sflow agent 192.168.100.240
-
Set the IP address for the sFlow collector.
Yamaha(config)#sflow collector 192.168.100.2
-
Set the sampling rate for packet flow sampling at the applicable port.
Yamaha(config)#interface port1.1 Yamaha(config-if)#sflow sampling-rate 1000
-
Set the polling interval for counter sampling at the applicable port.
Yamaha(config)#interface port1.1 Yamaha(config-if)#sflow polling-interval 30
-
Enable sFlow.
Yamaha(config)#sflow enable
6. Points of Caution
-
sFlow is not compatible with management information bases (MIB).
-
In stack configurations, the show sflow sampling command does not synchronize sampling information between the main and member switches in the stack.
-
In environments with high communication volumes, the following might occur if a small value is specified for the sflow sampling-rate command. In such cases, consider changing the sflow sampling-rate command value.
-
Higher CPU usage rate values are displayed using the show environment command.
-
The “sFlow Drop Sampling Count” value displayed by the show sflow command is included in count values.
-
If that value is counted, packets sampled by packet flow sampling dropped because they cannot be processed due to the high load. (* The sampling is actually dropped in this case, not the packets themselves.)
-
-
Since the values vary depending on the number of sampling-target ports and whether or not other functions are operating, recommended values cannot simply be suggested. However, as a guideline, the sflow sampling-rate command values that are unlikely to cause sFlow drops even when all ports are in use are described below.
-
When using a 1G interface … 2000 (1/2000)
-
When using a 10G interface … 10000 (1/10000)
-
-