# 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.

1. Use the sflow enable command to enable sFlow functionality.

   - The default setting is sflow disable (disabled).

2. 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.

3. 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.

4. 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 sflow sampling-rate command can be set for up to five physical ports.

   - In the stack configuration, the sflow sampling-rate command can be set for up to five physical ports per member switch.

   - The ports to be set with the sflow sampling-rate command and mirror command cannot overlap.

   - 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.

     - Specifying the sampling rate using the sflow sampling-rate command results in the following actions.

       - On the receiving side, immediately after the setting, sampling will be performed when the first packet is received. After that, packets will be sampled at the specified sampling rate.

       - On the receiving side, the new sampling rate will be applied after sampling at the previous sampling rate setting is finished.

       - On the sending side, the new sampling rate will be applied immediately after the rate is set.

     - If the sampling rate is set again after deletion of the sflow sampling-rate command, the behavior will be as follows.

       - On the receiving side, the new sampling rate will be applied after sampling at the sampling rate specified before the command is deleted is finished.

         - This behavior applies even if you change the port for which the sflow sampling-rate command is set.

       - On the sending side, the new sampling rate will be applied immediately after the rate is set.

5. 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.

6. 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.

1. Set the IP address for the sFlow agent.

       Yamaha(config)#sflow agent 192.168.100.240

2. Set the IP address for the sFlow collector.

       Yamaha(config)#sflow collector 192.168.100.2

3. Set the sampling rate for packet flow sampling at the applicable port.

       Yamaha(config)#interface port1.1
       Yamaha(config-if)#sflow sampling-rate 1000

4. Set the polling interval for counter sampling at the applicable port.

       Yamaha(config)#interface port1.1
       Yamaha(config-if)#sflow polling-interval 30

5. 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 …​ 5000 (1/5000)

    - When using a 25G interface …​ 8000 (1/8000)

    - When using a 100G interface …​ 10000 (1/10000)

## 7. Related Documentation

None

Search result
No more search results.
There are no topics that match your search query.