- Table of Contents
-
- 13-Network Management and Monitoring Configuration Guide
- 00-Preface
- 01-System maintenance and debugging configuration
- 02-NQA configuration
- 03-NTP configuration
- 04-SNMP configuration
- 05-RMON configuration
- 06-Event MIB configuration
- 07-NETCONF configuration
- 08-CWMP configuration
- 09-EAA configuration
- 10-Process monitoring and maintenance configuration
- 11-Sampler configuration
- 12-Mirroring configuration
- 13-NetStream configuration
- 14-IPv6 NetStream configuration
- 15-sFlow configuration
- 16-Fast log output configuration
- 17-Flow log configuration
- 18-Information center configuration
- 19-GOLD configuration
- 20-Packet capture configuration
- 21-VNF connection configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
13-NetStream configuration | 155.03 KB |
Configuring NetStream filtering
Configuring NetStream sampling
Configuring the NetStream data export format
Configuring the refresh rate for NetStream version 9 template
Configuring NetStream flow aging
Configuring periodical flow aging
Configuring the NetStream data export
Configuring the NetStream traditional data export
Configuring the NetStream aggregation data export
Display and maintenance commands for NetStream
NetStream configuration examples
Example: Configuring NetStream traditional data export
Example: Configuring NetStream aggregation data export
Configuring NetStream
About NetStream
NetStream is an accounting technology that provides statistics on a per-flow basis. An IPv4 flow is defined by the following 7-tuple elements:
· Destination IP address.
· Source IP address.
· Destination port number.
· Source port number.
· Protocol number.
· ToS.
· Inbound or outbound interface.
NetStream architecture
A typical NetStream system includes the following elements:
· NetStream data exporter—A device configured with NetStream. The NDE provides the following functions:
¡ Classifies traffic flows by using the 7-tuple elements.
¡ Collects data from the classified flows.
¡ Aggregates and exports the data to the NSC.
· NetStream collector—A program running on an operating system. The NSC parses the packets received from the NDEs, and saves the data to its database.
· NetStream data analyzer—A network traffic analyzing tool. Based on the data in NSC, the NDA generates reports for traffic billing, network planning, and attack detection and monitoring. The NDA can collect data from multiple NSCs. Typically, the NDA features a Web-based system for easy operation.
NSC and NDA are typically integrated into a NetStream server.
Figure 1 NetStream system
NetStream flow aging
NetStream uses flow aging to enable the NDE to export NetStream data to NetStream servers. NetStream creates a NetStream entry for each flow for storing the flow statistics in the cache.
When a flow is aged out, the NDE performs the following operations:
· Exports the summarized data to NetStream servers in a specific format.
· Clears NetStream entry information in the cache.
NetStream supports the following flow aging methods:
· Periodical aging.
· Forced aging.
Periodical aging
Periodical aging uses the following methods:
· Inactive flow aging—A flow is inactive if no packet arrives for the NetStream entry within the inactive flow aging timer. When the timer expires, the following events occur:
¡ The inactive flow entry is aged out.
¡ The statistics of the flow are sent to NetStream servers and are cleared in the cache. The statistics can no longer be displayed by using the display ip netstream cache command.
This method ensures that inactive flow entries are cleared from the cache in a timely manner so new entries can be cached.
· Active flow aging—A flow is active if packets arrive for the NetStream entry within the active flow aging timer. When the timer expires, the statistics of the active flow are exported to NetStream servers. The device continues to collect active flow statistics.
This method periodically exports the statistics of active flows to NetStream servers.
Forced aging
To implement forced aging, use one of the following methods:
· Clear the NetStream cache immediately. All entries in the cache are aged out and exported to NetStream servers.
· Specify the upper limit for cached entries and configure the system to take either of the following actions when the limit is reached:
¡ Age out the oldest entries.
¡ Disable creation of a new entry in the cache.
NetStream data export
Traditional data export
Traditional NetStream collects the statistics of each flow and exports the statistics to NetStream servers.
This method consumes more bandwidth and CPU than the aggregation method, and it requires a large cache size.
Aggregation data export
NetStream aggregation merges the flow statistics according to the aggregation criteria of an aggregation mode, and it sends the summarized data to NetStream servers. The NetStream aggregation data export uses less bandwidth than the traditional data export.
Table 1 lists the available aggregation modes. In each mode, the system merges statistics for multiple flows into statistics for one aggregate flow if each aggregation criterion is of the same value. The system records the statistics for the aggregate flow. These aggregation modes work independently and can take effect concurrently.
For example, when the aggregation mode configured on the NDE is protocol-port, NetStream aggregates the statistics of flow entries by protocol number, source port, and destination port. Four NetStream entries record four TCP flows with the same destination address, source port, and destination port, but with different source addresses. In the aggregation mode, only one NetStream aggregation entry is created and sent to NetStream servers.
Table 1 NetStream aggregation modes
Aggregation mode |
Aggregation criteria |
AS aggregation |
· Source AS number · Destination AS number · Inbound interface index · Outbound interface index |
Protocol-port aggregation |
· Protocol number · Source port · Destination port |
Source-prefix aggregation |
· Source AS number · Source address mask length · Source prefix (source network address) · Inbound interface index |
Destination-prefix aggregation |
· Destination AS number · Destination address mask length · Destination prefix (destination network address) · Outbound interface index |
Source and destination prefix aggregation |
· Source AS number · Destination AS number · Source address mask length · Destination address mask length · Source prefix · Destination prefix · Inbound interface index · Outbound interface index |
Prefix-port aggregation |
· Source prefix · Destination prefix · Source address mask length · Destination address mask length · ToS · Protocol number · Source port · Destination port · Inbound interface index · Outbound interface index |
ToS-AS aggregation |
· ToS · Source AS number · Destination AS number · Inbound interface index · Outbound interface index |
ToS-source-prefix aggregation |
· ToS · Source AS number · Source prefix · Source address mask length · Inbound interface index |
ToS-destination-prefix aggregation |
· ToS · Destination AS number · Destination address mask length · Destination prefix · Outbound interface index |
ToS-prefix aggregation |
· ToS · Source AS number · Source prefix · Source address mask length · Destination AS number · Destination address mask length · Destination prefix · Inbound interface index · Outbound interface index |
ToS-protocol-port aggregation |
· ToS · Protocol type · Source port · Destination port · Inbound interface index · Outbound interface index |
ToS-BGP-nexthop |
· ToS · BGP next hop · Outbound interface index |
If packets are not forwarded according to the BGP routing table, the AS number or BGP next hop cannot be obtained.
NetStream export formats
NetStream exports data in UDP datagrams in one of the following formats:
· Version 5—Exports original statistics collected based on the 7-tuple elements and does not support the NetStream aggregation data export. The packet format is fixed and cannot be extended.
· Version 8—Supports the NetStream aggregation data export. The packet format is fixed and cannot be extended.
· Version 9—Based on a template that can be configured according to the template formats defined in RFCs. Version 9 supports exporting the NetStream aggregation data and collecting statistics about BGP next hop packets.
NetStream filtering
NetStream filtering uses an ACL to identify packets. Whether NetStream collects data for identified packets depends on the action in the matching rule.
· NetStream collects data for packets that match permit rules in the ACL.
· NetStream does not collect data for packets that match deny rules in the ACL.
For more information about ACL, see ACL and QoS Configuration Guide.
NetStream sampling
NetStream sampling collects statistics on fewer packets and is useful when the network has a large amount of traffic. NetStream on sampled traffic lessens the impact on the device's performance. For more information about sampling, see "Configuring samplers."
Protocols and standards
RFC 5101, Specification of the IP Flow Information Export (IPFIX) Protocol for the Exchange of IP Traffic Flow Information
NetStream tasks at a glance
To configure NetStream, perform the following tasks:
2. (Optional.) Configuring NetStream filtering
3. (Optional.) Configuring NetStream sampling
4. (Optional.) Configuring the NetStream data export format
5. (Optional.) Configuring the refresh rate for NetStream version 9 template
6. (Optional.) Configuring NetStream flow aging
¡ Configuring periodical flow aging
¡ Configuring forced flow aging
7. Configuring the NetStream data export
a. Configuring the NetStream traditional data export
b. (Optional.) Configuring the NetStream aggregation data export
Enabling NetStream
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Enable NetStream on the interface.
ip netstream { inbound | outbound }
By default, NetStream is disabled on an interface.
Configuring NetStream filtering
About NetStream filtering
NetStream filtering uses an ACL to identify packets.
· To enable NetStream to collect statistics for specific flows, use the ACL permit statements to identify these flows
· To disable NetStream from collecting statistics for specific flows, use the ACL deny statements to identify these flows.
Restrictions and guidelines
When NetStream filtering and sampling are both configured, packets are filtered first, and then the permitted packets are sampled.
The NetStream filtering feature does not take effect on MPLS packets.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Enable NetStream filtering on the interface.
ip netstream { inbound | outbound } filter acl ipv4-acl-number
By default, NetStream filtering is disabled. NetStream collects statistics of all IPv4 packets passing through the interface.
Configuring NetStream sampling
Restrictions and guidelines
If NetStream sampling and filtering are both configured, packets are filtered first, and then the permitted packets are sampled.
Procedure
1. Enter system view.
system-view
2. Create a sampler.
sampler sampler-name mode { fixed | random } packet-interval n-power rate
For more information about a sampler, see "Configuring samplers."
3. Enter interface view.
interface interface-type interface-number
4. Enable NetStream sampling.
ip netstream { inbound | outbound } sampler sampler-name
By default, NetStream sampling is disabled.
Configuring the NetStream data export format
About NetStream data export
When you configure the NetStream data export format, you can also specify the following settings:
· Whether or not to export the BGP next hop information.
Exporting the BGP next hop information is supported only by the version 9 format.
· How to export the autonomous system (AS) information: origin-as or peer-as.
¡ origin-as—Records the original AS numbers for the flow source and destination.
¡ peer-as—Records the peer AS numbers for the flow source and destination.
For example, as shown in Figure 2, a flow starts at AS 20, passes AS 21 through AS 23, and then reaches AS 24. NetStream is enabled on the device in AS 22.
· Specify the origin-as keyword to export AS 20 as the source AS and AS 24 as the destination AS.
· Specify the peer-as keyword to export AS 21 as the source AS and AS 23 as the destination AS.
Figure 2 Recorded AS information varies by different keyword configurations
Procedure
1. Enter system view.
system-view
2. Configure the NetStream data export format, and configure the AS and BGP next hop export attributes. Choose one option as needed:
¡ Set NetStream data export format to version 5 and configure the AS export attribute.
ip netstream export version 5 { origin-as | peer-as }
¡ Set NetStream data export format to version 9 and configure the AS and BGP export attributes.
ip netstream export version 9 { origin-as | peer-as } [ bgp-nexthop ]
By default:
¡ NetStream data export uses the version 9 format.
¡ The peer AS numbers for the flow source and destination are exported.
¡ The BGP next hop information is not exported.
Configuring the refresh rate for NetStream version 9 template
About NetStream template refresh rate
Version 9 is template-based and supports user-defined formats. A NetStream device must send the template to NetStream servers regularly, because the servers do not permanently save template.
For a NetStream server to use the correct version 9 template, configure the time-based or packet count-based refresh rate. If both settings are configured, the template is sent when either of the conditions is met.
Procedure
1. Enter system view.
system-view
2. Configure the refresh rate for the NetStream version 9 template.
ip netstream export v9-template refresh-rate { packet packets | time minutes }
By default, the packet count-based refresh rate is 20 packets, and the time-based refresh interval is 30 minutes.
Configuring NetStream flow aging
Configuring periodical flow aging
1. Enter system view.
system-view
2. Set the aging timer for active flows.
ip netstream timeout active minutes
By default, the aging timer for active flows is 30 minutes.
3. Set the aging timer for inactive flows.
ip netstream timeout inactive seconds
By default, the aging timer for inactive flows is 30 seconds.
Configuring forced flow aging
1. Enter system view.
system-view
2. Set the upper limit for cached entries and specify the processing method when the limit is reached.
ip netstream max-entry { max-entries | aging | disable-caching }
3. Return to user view.
quit
4. Clear the cache, including the cached NetStream entries and the related statistics.
reset ip netstream statistics
Configuring the NetStream data export
Configuring the NetStream traditional data export
1. Enter system view.
system-view
2. Specify a destination host for NetStream traditional data export.
ip netstream export host ip-address udp-port [ vpn-instance vpn-instance-name ]
By default, no destination host is specified.
3. (Optional.) Specify the source interface for NetStream data packets sent to NetStream servers.
ip netstream export source interface interface-type interface-number
By default, NetStream data packets take the IP address of their output interface (interface that is connected to the NetStream device) as the source IP address.
As a best practice, connect the management Ethernet interface to a NetStream server, and configure the interface as the source interface.
4. (Optional.) Limit the data export rate.
ip netstream export rate rate
By default, the data export rate is not limited.
Configuring the NetStream aggregation data export
About NetStream aggregation data export
NetStream aggregation can be implemented by software or hardware. It merges flow statistics according to the aggregation mode criteria, and stores the data in the cache.
Restrictions and guidelines
Configurations in NetStream aggregation mode view apply only to the NetStream aggregation data export, and those in system view apply to the NetStream traditional data export. If configurations in NetStream aggregation mode view are not provided, the configurations in system view apply to the NetStream aggregation data export.
If the version 5 format is configured to export NetStream data, NetStream aggregation data export uses the version 8 format.
Procedure
1. Enter system view.
system-view
2. Specify a NetStream aggregation mode and enter its view.
ip netstream aggregation { as | destination-prefix | prefix | prefix-port | protocol-port | source-prefix | tos-as | tos-bgp-nexthop | tos-destination-prefix | tos-prefix | tos-protocol-port | tos-source-prefix }
By default, no NetStream aggregation mode is configured.
3. Enable the NetStream aggregation mode.
enable
By default, all NetStream aggregation modes are disabled.
4. Specify a destination host for NetStream aggregation data export.
ip netstream export host ip-addrress udp-port [ vpn-instance vpn-instance-name ]
By default, no destination host is specified.
If you expect only NetStream aggregation data, specify the destination host only in the related NetStream aggregation mode view.
5. (Optional.) Specify the source interface for NetStream data packets sent to NetStream servers.
ip netstream export source interface interface-type interface-number
By default, no source interface is specified for NetStream data packets. The packets take the IP address of the output interface as the source IP address.
Source interfaces in different NetStream aggregation mode views can be different.
If no source interface is configured in NetStream aggregation mode view, the source interface configured in system view applies.
Display and maintenance commands for NetStream
Execute display commands in any view and reset commands in user view.
Task |
Command |
Display NetStream entry information. |
In standalone mode: display ip netstream cache [ verbose ] [ type { ip | ipl2 | l2 | mpls [ label-position1 label-value1 [ label-position2 label-value2 [ label-position3 label-value3 ] ] ] } ] [ destination destination-ip | destination-port destination-port | interface interface-type interface-number | protocol protocol | source source-ip | source-port source-port ] * [ arrived-time start-date start-time end-date end-time ] In IRF mode: display ip netstream cache [ verbose ] [ type { ip | ipl2 | l2 | mpls [ label-position1 label-value1 [ label-position2 label-value2 [ label-position3 label-value3 ] ] ] } ] [ destination destination-ip | destination-port destination-port | interface interface-type interface-number | protocol protocol | source source-ip | source-port source-port ] * [ arrived-time start-date start-time end-date end-time ] [ slot slot-number ] |
Display information about the NetStream data export. |
display ip netstream export |
Display NetStream template information. |
In standalone mode: display ip netstream template In IRF mode: display ip netstream template [ slot slot-number ] |
Age out and export all NetStream data, and clear the cache. |
reset ip netstream statistics |
NetStream configuration examples
Example: Configuring NetStream traditional data export
Network configuration
As shown in Figure 3, configure NetStream on the device to collect statistics on packets passing through the device.
· Enable NetStream for incoming and outgoing traffic on GigabitEthernet 1/0.
· Configure the device to export NetStream traditional data to UDP port 5000 of the NetStream server.
Procedure
# Assign an IP address to each interface, as shown in Figure 3. (Details not shown.)
# Enable NetStream for incoming and outgoing traffic on GigabitEthernet 1/0.
<Device> system-view
[Device] interface gigabitethernet 1/0
[Device-GigabitEthernet1/0] ip netstream inbound
[Device-GigabitEthernet1/0] ip netstream outbound
[Device-GigabitEthernet1/0] quit
# Specify 12.110.2.2 as the IP address of the destination host and UDP port 5000 as the export destination port number.
[Device] ip netstream export host 12.110.2.2 5000
Verifying the configuration
# Display NetStream entry information.
[Device] display ip netstream cache
IP NetStream cache information:
Active flow timeout : 30 min
Inactive flow timeout : 30 sec
Inactive flow timeout : 30 sec
Max number of entries : 1024
IP active flow entries : 2
MPLS active flow entries : 0
L2 active flow entries : 0
IPL2 active flow entries : 0
IP flow entries counted : 0
MPLS flow entries counted : 0
L2 flow entries counted : 0
IPL2 flow entries counted : 0
Last statistics resetting time : Never
IP packet size distribution (11 packets in total):
1-32 64 96 128 160 192 224 256 288 320 352 384 416 448 480
.000 .000 .909 .000 .000 .090 .000 .000 .000 .000 .000 .000 .000 .000 .000
512 544 576 1024 1536 2048 2560 3072 3584 4096 4608 >4608
.000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000
Protocol Total Packets Flows Packets Active(sec) Idle(sec)
Flows /sec /sec /flow /flow /flow
---------------------------------------------------------------------------
Type DstIP(Port) SrcIP(Port) Pro ToS VNI APPID If(Direct) Pkts
DstMAC(VLAN) SrcMAC(VLAN)
TopLblType(IP/MASK) Lbl-Exp-S-List
---------------------------------------------------------------------------
IP 10.1.1.1 (21) 100.1.1.2(1024) 1 2 N/A 0xe GE1/0(I) 5
IP 100.1.1.2 (1024) 10.1.1.1 (21) 1 2 N/A 0xe GE1/0(O) 5
# Display information about the NetStream data export.
[Device] display ip netstream export
IP export information:
Flow source interface : Not specified
Flow destination VPN instance : Not specified
Flow destination IP address (UDP) : 12.110.2.2 (5000)
Version 5 exported flow number : 0
Version 5 exported UDP datagram number (failed) : 0 (0)
Version 9 exported flow number : 10
Version 9 exported UDP datagram number (failed) : 10 (0)
Example: Configuring NetStream aggregation data export
Network configuration
As shown in Figure 4, all routers in the network are running EBGP. Configure NetStream on the device to meet the following requirements:
· Use version 5 format to export NetStream traditional data to port 5000 of the NetStream server.
· Perform NetStream aggregation in the modes of protocol-port, source-prefix, destination-prefix, and prefix.
· Export the aggregation data of different modes to 4.1.1.1, with UDP ports 3000, 4000, 6000, and 7000.
Procedure
# Assign an IP address to each interface, as shown in Figure 4. (Details not shown.)
# Specify version 5 format to export NetStream traditional data and record the original AS numbers for the flow source and destination.
<Device> system-view
[Device] ip netstream export version 5 origin-as
# Enable NetStream for incoming and outgoing traffic on GigabitEthernet 1/0.
[Device] interface gigabitethernet 1/0
[Device-GigabitEthernet1/0] ip netstream inbound
[Device-GigabitEthernet1/0] ip netstream outbound
[Device-GigabitEthernet1/0] quit
# Specify 4.1.1.1 as the IP address of the destination host and UDP port 5000 as the export destination port number.
[Device] ip netstream export host 4.1.1.1 5000
# Set the aggregation mode to protocol-port, and specify the destination host for the aggregation data export.
[Device] ip netstream aggregation protocol-port
[Device-ns-aggregation-protport] enable
[Device-ns-aggregation-protport] ip netstream export host 4.1.1.1 3000
[Device-ns-aggregation-protport] quit
# Set the aggregation mode to source-prefix, and specify the destination host for the aggregation data export.
[Device] ip netstream aggregation source-prefix
[Device-ns-aggregation-srcpre] enable
[Device-ns-aggregation-srcpre] ip netstream export host 4.1.1.1 4000
[Device-ns-aggregation-srcpre] quit
# Set the aggregation mode to destination-prefix, and specify the destination host for the aggregation data export.
[Device] ip netstream aggregation destination-prefix
[Device-ns-aggregation-dstpre] enable
[Device-ns-aggregation-dstpre] ip netstream export host 4.1.1.1 6000
[Device-ns-aggregation-dstpre] quit
# Set the aggregation mode to prefix, and specify the destination host for the aggregation data export.
[Device] ip netstream aggregation prefix
[Device-ns-aggregation-prefix] enable
[Device-ns-aggregation-prefix] ip netstream export host 4.1.1.1 7000
[Device-ns-aggregation-prefix] quit
Verifying the configuration
# Display information about the NetStream data export.
[Device] display ip netstream export
protocol-port aggregation export information:
Flow source interface : Not specified
Flow destination VPN instance : Not specified
Flow destination IP address (UDP) : 4.1.1.1 (3000)
Version 8 exported flow number : 2
Version 8 exported UDP datagram number (failed) : 2 (0)
Version 9 exported flow number : 0
Version 9 exported UDP datagram number (failed) : 0 (0)
source-prefix aggregation export information:
Flow source interface : Not specified
Flow destination VPN instance : Not specified
Flow destination IP address (UDP) : 4.1.1.1 (4000)
Version 8 exported flow number : 2
Version 8 exported UDP datagram number (failed) : 2 (0)
Version 9 exported flow number : 0
Version 9 exported UDP datagram number (failed) : 0 (0)
destination-prefix aggregation export information:
Flow source interface : Not specified
Flow destination VPN instance : Not specified
Flow destination IP address (UDP) : 4.1.1.1 (6000)
Version 8 exported flow number : 2
Version 8 exported UDP datagram number (failed) : 2 (0)
Version 9 exported flow number : 0
Version 9 exported UDP datagram number (failed) : 0 (0)
prefix aggregation export information:
Flow source interface : Not specified
Flow destination VPN instance : Not specified
Flow destination IP address (UDP) : 4.1.1.1 (7000)
Version 8 exported flow number : 2
Version 8 exported UDP datagram number (failed) : 2 (0)
Version 9 exported flow number : 0
Version 9 exported UDP datagram number (failed) : 0 (0)
IP export information:
Flow source interface : Not specified
Flow destination VPN instance : Not specified
Flow destination IP address (UDP) : 4.1.1.1 (5000)
Version 5 exported flow number : 10
Version 5 exported UDP datagram number (failed) : 10 (0)
Version 9 exported flow number : 0
Version 9 exported UDP datagram number (failed) : 0 (0)