sFlow Support on Routers
Use Feature Explorer to confirm platform and release support for specific features.
Review the Platform-Specific sFlow Behavior section for notes related to your platform.
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. An sFlow monitoring system consists of an sFlow agent embedded in the device and up to four external collectors. The sFlow agent's two main activities are random sampling and statistics gathering. The sFlow agent performs packet sampling and gathers interface statistics, and then combines the information into UDP datagrams that are sent to the sFlow collectors.
Routers support the following sFlow features:
-
Packet-based sampling
-
Time-based sampling
-
Adaptive sampling
sFlow for GRE Encapsulation
sFlow supports the export of Extended Tunnel Egress Structure fields for traffic entering IPv4 or IPv6 GRE tunnels. This enables sFlow to provide information about GRE tunnel into which a packet entering the device might be encapsulated. The GRE tunnel could be IPv4 or IPv6. The feature is supported only when sFlow is enabled in the ingress direction wherein firewall based GRE encapsulation happens on IPv4 or IPv6 packets.
The feature is supported for the below traffic scenarios when ingress sFlow sampling is enabled:
-
Incoming IPv4 traffic that undergoes IPv4 GRE encapsulation
-
Incoming IPv6 traffic that undergoes IPv4 GRE encapsulation
-
Incoming IPv4 traffic that undergoes IPv6 GRE encapsulation
-
Incoming IPv6 traffic that undergoes IPv6 GRE encapsulation
To learn more about the sFlow and sFlow Tunnel Structures, see sFlow Tunnel Structures.
Table 1 describes extended tunnel egress structure fields for traffic entering IPv4 or IPv6 GRE tunnels.
Field Name | Value |
---|---|
Protocol reported | 0x2f (GRE) |
Source IP | IPv4 or IPv6 address of the tunnel source |
Destination IP | IPv4 or IPv6 address of the tunnel destination endpoint |
length | 0 |
source port | 0 |
destination port | 0 |
tcp flags | 0 |
priority | 0 |
The extended structure for IPv4 and IPv6 GRE tunnels is below:
/* opaque = flow_data; enterprise = 0; format = 1023 */ struct extended_ipv4_tunnel_egress { sampled_ipv4 header; } /* opaque = flow_data; enterprise = 0; format = 1025 */ struct extended_ipv6_tunnel_egress { sampled_ipv6 header; }
Sampled IPv4 header structure is below:
/* Packet IP version 4 data */ /* opaque = flow_data; enterprise = 0; format = 3 */ struct sampled_ipv4 { unsigned int length; /* The length of the IP packet excluding lower layer encapsulations */ unsigned int protocol; /* IP Protocol type (for example, TCP = 6, UDP = 17) */ ip_v4 src_ip; /* Source IP Address */ ip_v4 dst_ip; /* Destination IP Address */ unsigned int src_port; /* TCP/UDP source port number or equivalent */ unsigned int dst_port; /* TCP/UDP destination port number or equivalent unsigned int tcp_flags; /* TCP flags */ unsigned int tos; /* IP type of service */ }
Sampled IPv6 header structure is below:
/* Packet IP Version 6 Data */ /* opaque = flow_data; enterprise = 0; format = 4 */ struct sampled_ipv6 { unsigned int length; /* The length of the IP packet excluding lower layer encapsulations */ unsigned int protocol; /* IP next header (for example, TCP = 6, UDP = 17) */ ip_v6 src_ip; /* Source IP Address */ ip_v6 dst_ip; /* Destination IP Address */ unsigned int src_port; /* TCP/UDP source port number or equivalent */ unsigned int dst_port; /* TCP/UDP destination port number or equivalent*/ unsigned int tcp_flags; /* TCP flags */ unsigned int priority; /* IP priority */ }
sFlow Sample Size
You can configure the sFlow sample size of the raw packet header to be exported as part of
the sFlow record to the collector. The configurable range of sample size is from 128 bytes
through 512 bytes. Use the set protocols sflow sample-size
Sample-Size
command to configure the sample size. If the
configured sample size is greater than the actual packet size, then the actual size of the
packet is exported. If you do not configure the sample size, the default size of the raw
packet header exported to the collector is 128 bytes.
The sample size configured in the global sFlow configuration is inherited by all the interfaces configured under sFlow protocols.
Platform-Specific sFlow Behavior
Use Feature Explorer to confirm platform and release support for specific features.
Use the following table to review platform-specific behaviors for your platform.
Platform | Difference |
---|---|
ACX Series |
|
MX Series |
|
PTX Series |
|
Change History Table
Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.