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.
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 }
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. |
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
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
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/0 [~HUAWEI-GigabitEthernet0/1/0] ip netstream sampler fix-packets 1000 inbound
<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
<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
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/0 [~HUAWEI-GigabitEthernet0/1/0] ipv6 netstream sampler fix-packets 1000 inbound