Typical NetStream Configuration
Example for Configuring Original Flow Statistics Exporting
NetStream Overview
NetStream is a technology that collects statistics on and analyzes service traffic on networks. NetStream facilitates accounting and network monitoring.
It has the following advantages:
- NetStream collects statistics on multiple types of information in packets. It provides powerful statistics collection function and detailed statistical results.
- NetStream can be deployed at a low cost. No dedicated device is required to collect traffic information and no device interface is occupied.
Original flow statistics are exported when the flow aging time expires. Statistics on every flow are exported to the NetStream server. The NetStream server obtains detailed statistics on every flow.
Configuration Notes
NetStream conflicts with IP Source Trail on modular switches, so do not configure them simultaneously.
- Modular switches: For the applicable versions, see Table 3-1 in the section "Applicable Products and Versions."
- S5700-HI, S5710-EI, S5710-HI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-S, S5731S-H, S5732-H, S6720-HI, S6730-H, S6730S-H, S6730-S, S6730S-S: For the applicable versions, see Table 3-1 in the section "Applicable Products and Versions."
For S7700&S9700 series switches, NetStream is only supported by B series cards, E series cards (except ET1D2X48SEC0 card and EH1D2X48SEC0 card), and X series cards.
Networking Requirements
As shown in Figure 3-272, Department 1 and Department 2 connect to the Internet through SwitchA. Network administrators want to monitor communication between the two departments and the Internet, and perform accounting for each department.
Configuration Roadmap
You can configure IPv4 original flow statistics exporting on GE1/0/1 of SwitchA. Configure SwitchA to collect statistics on incoming and outgoing traffic on the interface, and to send the statistics to the NetStream server for further analysis. In this way, you can monitor communication between the two departments and the Internet, and perform accounting for each department.
The configuration roadmap is as follows:
- Configure IP addresses for interfaces on SwitchA.
- Configure NetStream sampling.
- Configure NetStream flow aging.
- Configure original flow statistics exporting.
- Configure the version of exported packets.
- Enable NetStream flow statistics collection on GE1/0/1.
Procedure
- Configure IP addresses for interfaces on SwitchA according to Figure 3-272.
# Configure IP addresses for interfaces on SwitchA.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 100 200 300 400 [SwitchA] interface vlanif 100 [SwitchA-Vlanif100] ip address 10.1.1.1 24 [SwitchA-Vlanif100] quit [SwitchA] interface vlanif 200 [SwitchA-Vlanif200] ip address 10.1.2.1 24 [SwitchA-Vlanif200] quit [SwitchA] interface vlanif 300 [SwitchA-Vlanif300] ip address 10.1.3.1 24 [SwitchA-Vlanif300] quit [SwitchA] interface vlanif 400 [SwitchA-Vlanif400] ip address 10.1.4.1 24 [SwitchA-Vlanif400] quit [SwitchA] interface gigabitethernet 1/0/1 [SwitchA-GigabitEthernet1/0/1] port link-type hybrid [SwitchA-GigabitEthernet1/0/1] port hybrid pvid vlan 100 [SwitchA-GigabitEthernet1/0/1] port hybrid untagged vlan 100 [SwitchA-GigabitEthernet1/0/1] quit [SwitchA] interface gigabitethernet 1/0/2 [SwitchA-GigabitEthernet1/0/2] port link-type hybrid [SwitchA-GigabitEthernet1/0/2] port hybrid pvid vlan 200 [SwitchA-GigabitEthernet1/0/2] port hybrid untagged vlan 200 [SwitchA-GigabitEthernet1/0/2] quit [SwitchA] interface gigabitethernet 1/0/3 [SwitchA-GigabitEthernet1/0/3] port link-type hybrid [SwitchA-GigabitEthernet1/0/3] port hybrid pvid vlan 300 [SwitchA-GigabitEthernet1/0/3] port hybrid untagged vlan 300 [SwitchA-GigabitEthernet1/0/3] quit [SwitchA] interface gigabitethernet 1/0/4 [SwitchA-GigabitEthernet1/0/4] port link-type hybrid [SwitchA-GigabitEthernet1/0/4] port hybrid pvid vlan 400 [SwitchA-GigabitEthernet1/0/4] port hybrid untagged vlan 400 [SwitchA-GigabitEthernet1/0/4] quit
- Configure NetStream sampling.
# Configure NetStream sampling on GE1/0/1, set the sampling ratio to 1200.
[SwitchA] interface gigabitethernet 1/0/1 [SwitchA-GigabitEthernet1/0/1] ip netstream sampler fix-packets 1200 inbound [SwitchA-GigabitEthernet1/0/1] ip netstream sampler fix-packets 1200 outbound [SwitchA-GigabitEthernet1/0/1] quit
- Configure NetStream flow aging.
# Set the inactive aging time to 100 seconds and enable FIN- and RST-based aging.
[SwitchA] ip netstream timeout inactive 100 [SwitchA] ip netstream tcp-flag enable
- Configure NetStream original flow statistics exporting.
# Set the source IP address of the exported packets carrying original flow statistics to 10.1.2.1, destination IP address to 10.1.2.2, and destination port number to 6000.
[SwitchA] ip netstream export source 10.1.2.1 [SwitchA] ip netstream export host 10.1.2.2 6000
- Configure the version of exported packets.
# Set the version of exported packets to V9.
[SwitchA] ip netstream export version 9
- Enable NetStream flow statistics collection on GE1/0/1.
# Enable NetStream flow statistics collection on GE1/0/1.
[SwitchA] interface gigabitethernet 1/0/1 [SwitchA-GigabitEthernet1/0/1] ip netstream inbound [SwitchA-GigabitEthernet1/0/1] ip netstream outbound [SwitchA-GigabitEthernet1/0/1] quit [SwitchA] quit
- Verify the configuration.
# After the configuration is complete, the NetStream server can receive statistics packets from SwitchA. Run the display ip netstream statistics command on SwitchA to view NetStream flow statistics.
<SwitchA> display ip netstream statistics slot 1 ===== Netstream statistics: ===== Origin/Flexible ingress entries : 35 Origin/Flexible ingress packets : 381920 Origin/Flexible ingress octets : 125269760 Origin/Flexible egress entries : 0 Origin/Flexible egress packets : 0 Origin/Flexible egress octets : 0 Origin/Flexible total entries : 35 Handle origin entries : 35 Handle As aggre entries : 0 Handle ProtPort aggre entries : 0 Handle SrcPrefix aggre entries : 0 Handle DstPrefix aggre entries : 0 Handle Prefix aggre entries : 0 Handle AsTos aggre entries : 0 Handle ProtPortTos aggre entries : 0 Handle SrcPreTos aggre entries : 0 Handle DstPreTos aggre entries : 0 Handle PreTos aggre entries : 0
Configuration Files
Configuration file of SwitchA
# sysname SwitchA # vlan batch 100 200 300 400 # ip netstream timeout inactive 100 ip netstream export version 9 ip netstream export source 10.1.2.1 ip netstream export host 10.1.2.2 6000 # ip netstream tcp-flag enable # interface Vlanif100 ip address 10.1.1.1 255.255.255.0 # interface Vlanif200 ip address 10.1.2.1 255.255.255.0 # interface Vlanif300 ip address 10.1.3.1 255.255.255.0 # interface Vlanif400 ip address 10.1.4.1 255.255.255.0 # interface GigabitEthernet1/0/1 port link-type hybrid port hybrid pvid vlan 100 port hybrid untagged vlan 100 ip netstream inbound ip netstream outbound ip netstream sampler fix-packets 1200 inbound ip netstream sampler fix-packets 1200 outbound # interface GigabitEthernet1/0/2 port link-type hybrid port hybrid pvid vlan 200 port hybrid untagged vlan 200 # interface GigabitEthernet1/0/3 port link-type hybrid port hybrid pvid vlan 300 port hybrid untagged vlan 300 # interface GigabitEthernet1/0/4 port link-type hybrid port hybrid pvid vlan 400 port hybrid untagged vlan 400 # return
Example for Configuring Aggregation Flow Statistics Exporting
NetStream Overview
NetStream is a technology that collects statistics on and analyzes service traffic on networks. NetStream facilitates accounting and network monitoring.
It has the following advantages:
- NetStream collects statistics on multiple types of information in packets. It provides powerful statistics collection function and detailed statistical results.
- NetStream can be deployed at a low cost. No dedicated device is required to collect traffic information and no device interface is occupied.
In aggregation flow statistics exporting, the device summarizes the flows with the same aggregation keywords, and obtains statistics on the aggregation flow. The aggregation flow statistics obviously reduce bandwidth occupation.
Configuration Notes
NetStream conflicts with IP Source Trail on modular switches, so do not configure them simultaneously.
- Modular switches: For the applicable versions, see Table 3-1 in the section "Applicable Products and Versions."
- S5700-HI, S5710-EI, S5710-HI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-S, S5731S-H, S5732-H, S6720-HI, S6730-H, S6730S-H, S6730-S, S6730S-S: For the applicable versions, see Table 3-1 in the section "Applicable Products and Versions."
For S7700&S9700 series switches, NetStream is only supported by B series cards, E series cards (except ET1D2X48SEC0 card and EH1D2X48SEC0 card), and X series cards.
Networking Requirements
As shown in Figure 3-273, Department 1 and Department 2 connect to the Internet through SwitchA. Network administrators want to monitor communication between the two departments and the Internet.
Configuration Roadmap
You can configure IPv4 aggregation flow statistics exporting on GE1/0/1 of SwitchA. Configure SwitchA to collect statistics on incoming and outgoing traffic on the interface, and to send the statistics to the NetStream server for further analysis. In this way, you can monitor communication between the two departments and the Internet.
The configuration roadmap is as follows:
- Configure IP addresses for interfaces on SwitchA.
- Configure NetStream aggregation flow statistics exporting.
- Configure the version of exported packets.
- Enable NetStream flow statistics collection on GE1/0/1.
Procedure
- Configure IP addresses for interfaces on SwitchA according to Figure 3-273.
# Configure IP addresses for interfaces on SwitchA.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 100 200 300 400 [SwitchA] interface vlanif 100 [SwitchA-Vlanif100] ip address 10.1.1.1 24 [SwitchA-Vlanif100] quit [SwitchA] interface vlanif 200 [SwitchA-Vlanif200] ip address 10.1.2.1 24 [SwitchA-Vlanif200] quit [SwitchA] interface vlanif 300 [SwitchA-Vlanif300] ip address 10.1.3.1 24 [SwitchA-Vlanif300] quit [SwitchA] interface vlanif 400 [SwitchA-Vlanif400] ip address 10.1.4.1 24 [SwitchA-Vlanif400] quit [SwitchA] interface gigabitethernet 1/0/1 [SwitchA-GigabitEthernet1/0/1] port link-type hybrid [SwitchA-GigabitEthernet1/0/1] port hybrid pvid vlan 100 [SwitchA-GigabitEthernet1/0/1] port hybrid untagged vlan 100 [SwitchA-GigabitEthernet1/0/1] quit [SwitchA] interface gigabitethernet 1/0/2 [SwitchA-GigabitEthernet1/0/2] port link-type hybrid [SwitchA-GigabitEthernet1/0/2] port hybrid pvid vlan 200 [SwitchA-GigabitEthernet1/0/2] port hybrid untagged vlan 200 [SwitchA-GigabitEthernet1/0/2] quit [SwitchA] interface gigabitethernet 1/0/3 [SwitchA-GigabitEthernet1/0/3] port link-type hybrid [SwitchA-GigabitEthernet1/0/3] port hybrid pvid vlan 300 [SwitchA-GigabitEthernet1/0/3] port hybrid untagged vlan 300 [SwitchA-GigabitEthernet1/0/3] quit [SwitchA] interface gigabitethernet 1/0/4 [SwitchA-GigabitEthernet1/0/4] port link-type hybrid [SwitchA-GigabitEthernet1/0/4] port hybrid pvid vlan 400 [SwitchA-GigabitEthernet1/0/4] port hybrid untagged vlan 400 [SwitchA-GigabitEthernet1/0/4] quit
- Configure NetStream aggregation flow statistics exporting.
# Configure the aggregation keyword protocol-port, and set the source IP address of the exported packets to 10.1.2.1, destination IP address to 10.1.2.2, and destination port number to 6000.
[SwitchA] ip netstream aggregation protocol-port [SwitchA-aggregation-protport] ip netstream export source 10.1.2.1 [SwitchA-aggregation-protport] ip netstream export host 10.1.2.2 6000 [SwitchA-aggregation-protport] enable
- Configure the version of exported packets.
# Set the version of the exported packets carrying aggregation flow statistics to V9.
[SwitchA-aggregation-protport] export version 9 [SwitchA-aggregation-protport] quit
- Enable NetStream flow statistics collection on GE1/0/1.
# Enable NetStream flow statistics collection on GE1/0/1.
[SwitchA] interface gigabitethernet 1/0/1 [SwitchA-GigabitEthernet1/0/1] ip netstream inbound [SwitchA-GigabitEthernet1/0/1] ip netstream outbound [SwitchA-GigabitEthernet1/0/1] quit [SwitchA] quit
- Verify the configuration.
# After the configuration is complete, the NetStream server can receive statistics packets from SwitchA. Run the display ip netstream statistics command on SwitchA to view NetStream flow statistics.
<SwitchA> display ip netstream statistics slot 1 ===== Netstream statistics: ===== Origin/Flexible ingress entries : 95 Origin/Flexible ingress packets : 1036640 Origin/Flexible ingress octets : 340017920 Origin/Flexible egress entries : 0 Origin/Flexible egress packets : 0 Origin/Flexible egress octets : 0 Origin/Flexible total entries : 95 Handle origin entries : 95 Handle As aggre entries : 0 Handle ProtPort aggre entries : 8 Handle SrcPrefix aggre entries : 0 Handle DstPrefix aggre entries : 0 Handle Prefix aggre entries : 0 Handle AsTos aggre entries : 0 Handle ProtPortTos aggre entries : 0 Handle SrcPreTos aggre entries : 0 Handle DstPreTos aggre entries : 0 Handle PreTos aggre entries : 0
Configuration Files
Configuration file of SwitchA
# sysname SwitchA # vlan batch 100 200 300 400 # interface Vlanif100 ip address 10.1.1.1 255.255.255.0 # interface Vlanif200 ip address 10.1.2.1 255.255.255.0 # interface Vlanif300 ip address 10.1.3.1 255.255.255.0 # interface Vlanif400 ip address 10.1.4.1 255.255.255.0 # interface GigabitEthernet1/0/1 port link-type hybrid port hybrid pvid vlan 100 port hybrid untagged vlan 100 ip netstream inbound ip netstream outbound # interface GigabitEthernet1/0/2 port link-type hybrid port hybrid pvid vlan 200 port hybrid untagged vlan 200 # interface GigabitEthernet1/0/3 port link-type hybrid port hybrid pvid vlan 300 port hybrid untagged vlan 300 # interface GigabitEthernet1/0/4 port link-type hybrid port hybrid pvid vlan 400 port hybrid untagged vlan 400 # ip netstream aggregation protocol-port ip netstream export source 10.1.2.1 ip netstream export host 10.1.2.2 6000 enable export version 9 # return
Example for Configuring Flexible Flow Statistics Exporting
NetStream Overview
NetStream is a technology that collects statistics on and analyzes service traffic on networks. NetStream facilitates accounting and network monitoring.
It has the following advantages:
- NetStream collects statistics on multiple types of information in packets. It provides powerful statistics collection function and detailed statistical results.
- NetStream can be deployed at a low cost. No dedicated device is required to collect traffic information and no device interface is occupied.
In flexible flow statistics exporting, flows are set based on customized rules. You can customize flows based on the protocol type, DSCP priority, source IP address, destination IP address, source port number, destination port number, or flow label as required. Flexible flow statistics are sent to the NetStream server. Compared with original flow statistics collection, flexible flow statistics collection occupies less traffic and is more flexible.
Configuration Notes
NetStream conflicts with IP Source Trail on modular switches, so do not configure them simultaneously.
- Modular switches: For the applicable versions, see Table 3-1 in the section "Applicable Products and Versions."
- S5700-HI, S5710-EI, S5710-HI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-S, S5731S-H, S5732-H, S6720-HI, S6730-H, S6730S-H, S6730-S, S6730S-S: For the applicable versions, see Table 3-1 in the section "Applicable Products and Versions."
For S7700&S9700 series switches, NetStream is only supported by B series cards, E series cards (except ET1D2X48SEC0 card and EH1D2X48SEC0 card), and X series cards.
Networking Requirements
As shown in Figure 3-274, Department 1 and Department 2 connect to the Internet through SwitchA. Network administrators want to monitor communication between the two departments and the Internet.
Configuration Roadmap
You can configure IPv4 flexible flow statistics exporting on GE1/0/1 of SwitchA. Configure SwitchA to collect statistics on incoming and outgoing traffic on the interface, and to send the statistics to the NetStream server for further analysis. In this way, you can monitor communication between the two departments and the Internet.
The configuration roadmap is as follows:
- Configure IP addresses for interfaces on SwitchA.
- Configure a flexible flow statistics template.
- Configure NetStream flexible flow statistics exporting.
- Enable flexible flow statistics collection on GE1/0/1.
Procedure
- Configure IP addresses for interfaces on SwitchA according to Figure 3-274.
# Configure IP addresses for interfaces on SwitchA.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 100 200 300 400 [SwitchA] interface vlanif 100 [SwitchA-Vlanif100] ip address 10.1.1.1 24 [SwitchA-Vlanif100] quit [SwitchA] interface vlanif 200 [SwitchA-Vlanif200] ip address 10.1.2.1 24 [SwitchA-Vlanif200] quit [SwitchA] interface vlanif 300 [SwitchA-Vlanif300] ip address 10.1.3.1 24 [SwitchA-Vlanif300] quit [SwitchA] interface vlanif 400 [SwitchA-Vlanif400] ip address 10.1.4.1 24 [SwitchA-Vlanif400] quit [SwitchA] interface gigabitethernet 1/0/1 [SwitchA-GigabitEthernet1/0/1] port link-type hybrid [SwitchA-GigabitEthernet1/0/1] port hybrid pvid vlan 100 [SwitchA-GigabitEthernet1/0/1] port hybrid untagged vlan 100 [SwitchA-GigabitEthernet1/0/1] quit [SwitchA] interface gigabitethernet 1/0/2 [SwitchA-GigabitEthernet1/0/2] port link-type hybrid [SwitchA-GigabitEthernet1/0/2] port hybrid pvid vlan 200 [SwitchA-GigabitEthernet1/0/2] port hybrid untagged vlan 200 [SwitchA-GigabitEthernet1/0/2] quit [SwitchA] interface gigabitethernet 1/0/3 [SwitchA-GigabitEthernet1/0/3] port link-type hybrid [SwitchA-GigabitEthernet1/0/3] port hybrid pvid vlan 300 [SwitchA-GigabitEthernet1/0/3] port hybrid untagged vlan 300 [SwitchA-GigabitEthernet1/0/3] quit [SwitchA] interface gigabitethernet 1/0/4 [SwitchA-GigabitEthernet1/0/4] port link-type hybrid [SwitchA-GigabitEthernet1/0/4] port hybrid pvid vlan 400 [SwitchA-GigabitEthernet1/0/4] port hybrid untagged vlan 400 [SwitchA-GigabitEthernet1/0/4] quit
- Configure a flexible flow statistics template.
# Create a flexible flow statistics template test to aggregate flows based on the destination IP address and destination port number, and configure the exported packets to contain the number of bytes and packets and the indexes of the inbound and outbound interfaces.
[SwitchA] ip netstream record test [SwitchA-record-test] match ip destination-address [SwitchA-record-test] match ip destination-port [SwitchA-record-test] collect interface input [SwitchA-record-test] collect interface output [SwitchA-record-test] collect counter bytes [SwitchA-record-test] collect counter packets [SwitchA-record-test] quit
- Configure NetStream flexible flow statistics exporting.
# Set the source IP address of the exported packets carrying flexible flow statistics to 10.1.2.1, destination IP address to 10.1.2.2, and destination port number to 6000.
[SwitchA] ip netstream export source 10.1.2.1 [SwitchA] ip netstream export host 10.1.2.2 6000
- Enable flexible flow statistics collection on GE1/0/1.
# Enable flexible flow statistics collection on GE1/0/1, and apply the flexible flow statistics template test to GE1/0/1.
[SwitchA] interface gigabitEthernet 1/0/1 [SwitchA-GigabitEthernet1/0/1] port ip netstream record test [SwitchA-GigabitEthernet1/0/1] ip netstream inbound [SwitchA-GigabitEthernet1/0/1] ip netstream outbound [SwitchA-GigabitEthernet1/0/1] quit [SwitchA] quit
- Verify the configuration.
# After the configuration is complete, the NetStream server can receive statistics packets from SwitchA. Run the display ip netstream statistics command on SwitchA to view NetStream flow statistics.
<SwitchA> display ip netstream statistics slot 1 ===== Netstream statistics: ===== Origin/Flexible ingress entries : 20 Origin/Flexible ingress packets : 176541 Origin/Flexible ingress octets : 123657230 Origin/Flexible egress entries : 0 Origin/Flexible egress packets : 0 Origin/Flexible egress octets : 0 Origin/Flexible total entries : 20 Handle origin entries : 0 Handle As aggre entries : 0 Handle ProtPort aggre entries : 0 Handle SrcPrefix aggre entries : 0 Handle DstPrefix aggre entries : 0 Handle Prefix aggre entries : 0 Handle AsTos aggre entries : 0 Handle ProtPortTos aggre entries : 0 Handle SrcPreTos aggre entries : 0 Handle DstPreTos aggre entries : 0 Handle PreTos aggre entries : 0 Record test handle entries : 10
Configuration Files
Configuration file of SwitchA
# sysname SwitchA # vlan batch 100 200 300 400 # ip netstream export source 10.1.2.1 ip netstream export host 10.1.2.2 6000 # ip netstream record test match ip destination-address match ip destination-port collect counter packets collect counter bytes collect interface input collect interface output # interface Vlanif100 ip address 10.1.1.1 255.255.255.0 # interface Vlanif200 ip address 10.1.2.1 255.255.255.0 # interface Vlanif300 ip address 10.1.3.1 255.255.255.0 # interface Vlanif400 ip address 10.1.4.1 255.255.255.0 # interface GigabitEthernet1/0/1 port link-type hybrid port hybrid pvid vlan 100 port hybrid untagged vlan 100 ip netstream inbound ip netstream outbound port ip netstream record test # interface GigabitEthernet1/0/2 port link-type hybrid port hybrid pvid vlan 200 port hybrid untagged vlan 200 # interface GigabitEthernet1/0/3 port link-type hybrid port hybrid pvid vlan 300 port hybrid untagged vlan 300 # interface GigabitEthernet1/0/4 port link-type hybrid port hybrid pvid vlan 400 port hybrid untagged vlan 400 # return