Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Example: Configure sFlow Technology to Monitor Network Traffic

This example describes how to configure and use sFlow technology to monitor network traffic.

Requirements

You can use ACX Series, EX Series, MX Series, PTX Series, and QFX Series devices for the example using the following hardware and software components:

  • One EX Series switch

  • Junos OS Release 9.3 or later for EX Series switches

  • One MX Series router

  • Junos OS Release 18.1 or later for MX Series routers

  • One QFX Series switch

  • Junos OS Release 11.3 or later for QFX Series switches

Topology

sFlow, a high-speed network monitoring technology, samples packets and transmits them in UDP datagrams to a collector, ensuring continuous traffic monitoring on all interfaces. You must enable sFlow monitoring on each interface individually. The sFlow agent on switches combines interface counters and flow samples, and forward raw packet headers to the collectors. The current version of sFlow is version 5 that transports the sampled data to the sFlow collector.

Figure 1 depicts the basic elements of the sFlow system.

Figure 1: sFlow Technology Monitoring System sFlow monitoring system architecture: sFlow Agents in network devices collect packet samples, send data via blue and red arrows to sFlow Collector for analysis and storage.

Configuration

To configure sFlow technology, perform the following tasks:

CLI Quick Configuration

To quickly configure sFlow technology, copy the following commands and paste them into the switch terminal window:

Procedure

Step-by-Step Procedure

To configure sFlow technology:

  1. Configure the IP address and UDP port of the collector:

    Note:

    You can configure a maximum of 4 collectors.

    The default UDP port is 6343.

  2. Enable sFlow technology on a specific interface:

    Note:

    You cannot enable sFlow technology on a Layer 3 VLAN-tagged interface.

  3. Specify in seconds how often the sFlow agent polls the interface:

    Note:

    The polling interval can be specified as a global parameter also. Specify 0 if you do not want to poll the interface.

  4. Specify the rate at which egress packets must be sampled:

    Note:

    You can specify both egress and ingress sampling rates. If you set only the egress sampling rate, the ingress sampling rate will be disabled.

    Note:

    We recommend that you configure the same sampling rates on all the ports on a line card. If you configure different sampling rates are different, the lowest value is used for all ports. You could still configure different rates on different line cards.

  5. (Optional) Specify the sample size for the raw packet header. The sample size configuration is applicable on PTX10003-80C, PTX10003-160C, PTX10001-36MR, PTX10004, PTX10008 and PTX10016 devices from 23.1R1 Junos OS Evolved release.

Results

Check the results of the configuration:

Verification

To confirm that the configuration is correct, perform these tasks:

Verifying That sFlow Technology Is Configured Properly

Purpose

Verify that sFlow technology is configured properly.

Action

Use the show sflow command:

Note:

The sampling limit cannot be configured and is set to 300 packets/second per FPC.

Meaning

The output shows that sFlow technology is enabled and specifies the values for the sampling limit, polling interval, and the egress sampling rate.

Verifying That sFlow Technology Is Enabled on the Specified Interface

Purpose

Verify that sFlow technology is enabled on the specified interfaces and display the sampling parameters.

Action

Use the show sflow interface command:

Meaning

The output indicates that sFlow technology is enabled on the ge-0/0/0.0 interface with an egress sampling rate of 1000, a disabled ingress sampling rate, and a polling interval of 20 seconds.

Verifying the sFlow Collector Configuration

Purpose

Verify the sFlow collector's configuration.

Action

Use the show sflow collector command:

Meaning

The output displays the IP address of the collectors and the UDP ports. It also displays the number of samples.