netstream sampler

Function

The ip netstream sampler command configures NetStream to IPv4 sample incoming and outgoing flows on the interface in a specified sampling mode and at a specified sampling ratio.

The undo ip netstream sampler command disables NetStream from sampling incoming and outgoing flows.

The ipv6 netstream sampler command configures NetStream to IPv6 sample incoming and outgoing flows on the interface in a specified sampling mode and at a specified sampling ratio.

The undo ipv6 netstream sampler command restores the default setting.

By default, NetStream is disabled from sampling incoming and outgoing flows. Instead, it collects statistics about each packet.

Format

ip netstream sampler fix-packets fix-packet-number { inbound | outbound }

ip netstream sampler random-packets random-packet-number { inbound | outbound }

ip netstream sampler fix-time fix-time-number { inbound | outbound }

ipv6 netstream sampler fix-time fix-time-number { inbound | outbound }

ipv6 netstream sampler fix-packets fix-packet-number { inbound | outbound }

ipv6 netstream sampler random-packets random-packet-number { inbound | outbound }

undo ip netstream sampler { inbound | outbound }

undo ipv6 netstream sampler { inbound | outbound }

Parameters

Parameter Description Value
inbound

Enables NetStream to sample incoming flows on an interface.

-

outbound

Enables NetStream to sample outgoing flows on an interface.

-

ip

Displays the IPv4 netstream feature.

-

random-packets random-packet-number

Enables the random packet sampling mode. In this mode, one packet is randomly sampled out of random-packets-number packets.

The value is an integer ranging from 1 to 65535.

fix-time fix-time-number

Enables the fixed time sampling mode. In this mode, one packet is sampled every fix-time-value milliseconds.

The value is an integer ranging from 5 to 30000, in ms.

ipv6

Displays the IPv6 netstream feature.

-

fix-packets fix-packet-number

Enables the fixed packet sampling mode. In this mode, one packet is sampled every fix-packets-number packets.

The value is an integer ranging from 1 to 65535.

Views

100GE Layer 2 sub-interface view, 100GE interface view, 25GE Layer 2 sub-interface view, 400GE Layer 2 sub-interface view, 400GE interface view, 40GE Layer 2 sub-interface view, 40GE interface view, 50GE Layer 2 sub-interface view, 50GE sub-interface view, 50GE interface view, Eth-Trunk Layer 2 sub-interface view, Eth-Trunk sub-interface view, Eth-Trunk interface view, FlexE sub-interface view, FlexE interface view, GE Layer 2 sub-interface view, GE sub-interface view, GE electrical interface view, Global VE sub-interface view, Multi-GE Layer 2 sub-interface view, T1 interface view, VBDIF interface view, VE sub-interface view, VLANIF interface view, XGE Layer 2 sub-interface view, Sub-interface view, System view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
netstream write

Usage Guidelines

Usage Scenario

If NetStream is enabled on an interface, the system records NetStream-related information in a specific interface information table. If each packet on an interface is collected and counted, forwarding performance of the interface (especially high-speed interfaces) greatly deteriorates. To learn the traffic characteristics of an interface and at the same time minimize the impact of packet statistics collection on interface forwarding performance, enable NetStream sampling on the interface. The lower the sampling ratio, the less the impact on the device performance.

Precautions

  1. IPv4 and IPv6 streams must be sampled in the same way with different sampling ratios.
  2. Configure any of the sampling ratios, and both IPv4 and IPv6 will take effect simultaneously.
  3. If the sampling ratio is not configured under the interface, the global sampling ratio configuration is used. If one stream type sampling ratio is configured on the interface, the other stream type uses the other stream type sampling ratio that has been configured on the interface.
  4. If the sampling mode supported by the interface does not include the current global sampling ratio configuration, the interface does not use the global sampling ratio.
  5. Due to CPCAR, packets may be discarded if the traffic rate on an interface is high. This will prevent the NetStream sampling rate from reaching 1:1 when a 1:1 rate is set.

Example

# Configure NetStream IPv4 to sample incoming packets on the GE 0/1/0 interface at the sampling ratio of 1000:1.
<HUAWEI> system-view
[~HUAWEI] interface GigabitEthernet 0/1/0
[~HUAWEI-GigabitEthernet0/1/0] ip netstream sampler fix-packets 1000 inbound
# Configure NetStream IPv4 to sample incoming packets on the VE sub-interface at the sampling ratio of 1000:1.
<HUAWEI> system-view
[~HUAWEI] interface virtual-ethernet 0/1/0
[~HUAWEI-Virtual-Ethernet0/1/0] ve-group 1 l3-access
[*HUAWEI-Virtual-Ethernet0/1/0] quit
[*HUAWEI] interface virtual-ethernet 0/1/0.1
[~HUAWEI-Virtual-Ethernet0/1/0.1] ip netstream sampler fix-packets 1000 inbound
# Configure NetStream IPv6 to sample incoming packets on the VE sub-interface at the sampling ratio of 1000:1.
<HUAWEI> system-view
[~HUAWEI] interface virtual-ethernet 0/1/0
[~HUAWEI-Virtual-Ethernet0/1/0] ve-group 1 l3-access
[*HUAWEI-Virtual-Ethernet0/1/0] quit
[*HUAWEI] interface virtual-ethernet 0/1/0.1
[~HUAWEI-Virtual-Ethernet0/1/0.1] ipv6 netstream sampler fix-packets 1000 inbound
# Configure NetStream IPv6 to sample incoming packets on the GE 0/1/0 interface at the sampling ratio of 1000:1.
<HUAWEI> system-view
[~HUAWEI] interface GigabitEthernet 0/1/0
[~HUAWEI-GigabitEthernet0/1/0] ipv6 netstream sampler fix-packets 1000 inbound
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >