- Table of Contents
-
- 14-Network Management and Monitoring Configuration Guide
- 00-Preface
- 01-System maintenance and debugging configuration
- 02-NQA configuration
- 03-NTP configuration
- 04-PTP configuration
- 05-Network synchronization configuration
- 06-SNMP configuration
- 07-RMON configuration
- 08-Event MIB configuration
- 09-NETCONF configuration
- 10-EAA configuration
- 11-Process monitoring and maintenance configuration
- 12-Sampler configuration
- 13-Mirroring configuration
- 14-NetStream configuration
- 15-IPv6 NetStream configuration
- 16-TCP connection trace configuration
- 17-Fast log output configuration
- 18-Flow log configuration
- 19-Information center configuration
- 20-GOLD configuration
- 21-Packet capture configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
14-NetStream configuration | 179.87 KB |
Enabling NetStream (system view)
Enabling NetStream (interface view)
Configuring NetStream mirroring
Configuring NetStream sampling
Configuring the RFC 7011-compliant template format
Configuring the NetStream data export format
Configuring the refresh rate for NetStream version 9 or version 10 template
Configuring MPLS-aware NetStream
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
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
This method clears the NetStream cache immediately. All entries in the cache are aged out and exported to NetStream servers.
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 |
BGP community |
· Inbound interface index · Outbound interface index · BGP community attribute |
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 |
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 and MPLS packets.
· Version 10—Similar to version 9. The difference between version 9 and version 10 is that version 10 export format is compliant with the IPFIX standard.
NetStream mirroring
NetStream mirroring copies the packets that pass through an interface to a NetStream module for collecting traffic statistics. The forwarding performance of the device is not affected.
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:
1. Enabling NetStream.
Choose one of the following tasks:
¡ Enabling NetStream (system view)
¡ Enabling NetStream (interface view)
2. Configuring NetStream mirroring
3. (Optional.) Configuring NetStream sampling
4. (Optional.) Configuring the RFC 7011-compliant template format
5. (Optional.) Configuring the NetStream data export format
6. (Optional.) Configuring the refresh rate for NetStream version 9 or version 10 template
7. (Optional.) Configuring MPLS-aware NetStream
8. (Optional.) Configuring NetStream flow aging
¡ Configuring periodical flow aging
¡ Configuring forced flow aging
9. Configuring the NetStream data export
a. Configuring the NetStream traditional data export
b. (Optional.) Configuring the NetStream aggregation data export
Enabling NetStream (system view)
Restrictions and guidelines
Enabling NetStream in system view does not enable NetStream on all interfaces. To enable NetStream on an interface, you still need to enable NetStream on this interface.
To use NetStream mirroring in interface view, you also have to enable NetStream in system view.
Procedure
1. Enter system view.
system-view
2. Enable NetStream.
ip netstream
By default, NetStream is disabled.
Enabling NetStream (interface view)
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Enable NetStream.
ip netstream { inbound | outbound }
By default, NetStream is disabled.
Configuring NetStream mirroring
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Mirror traffic on the interface to a slot.
ip netstream { inbound | outbound } mirror-to service chassis chassis-number slot slot-number [ backup chassis chassis-number slot slot-number ]
By default, traffic of an interface is not mirrored to a slot.
Configuring NetStream sampling
Restrictions and guidelines
By default, a NetStream-enabled device processes only one packet out of every 10000 packets for traffic statistics collection. You can use a sampler to set another sampling rate as needed. The higher the sampling rate, the less the impact on device performance. As a best practice, set a proper sampling rate to lessen the impact of hardware resource consumption on the device forwarding performance.
Procedure
1. Enter system view.
system-view
2. Create a sampler.
sampler sampler-name mode { fixed | random } packet-interval 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, the NetStream-enabled device processes only one packet out of every 10000 packets for traffic statistics collection.
Configuring the RFC 7011-compliant template format
About this task
By default, NetStream uses the H3C-defined template format to export data. This feature uses the template format defined by the RFC 7011 for data export.
Restrictions and guidelines
The NetStream template format on the device must be consistent with that on the server.
Procedure
1. Enter system view.
system-view
2. Configure NetStream to use the template format defined by the RFC 7011.
ip netstream template rfc7011
By default, NetStream uses the H3C-defined template format.
Configuring the NetStream data export format
About this task
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.
Only version 9 and version 10 formats support exporting the BGP next hop information.
· 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 or version 10 and configure the AS and BGP export attributes.
ip netstream export version { 9 | 10 } { 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 or version 10 template
About this task
Version 9 and version 10 are template-based and support user-defined formats. A NetStream device must send the template to NetStream servers regularly, because the servers do not permanently save templates.
For a NetStream server to use the correct version 9 or version 10 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 or version 10 template.
ip netstream export 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 MPLS-aware NetStream
About this task
An MPLS flow is identified by the same labels in the same position and the same 7-tuple elements. MPLS-aware NetStream collects statistics on a maximum of three labels in the label stack, with or without IP fields.
Procedure
1. Enter system view.
system-view
2. Collect statistics on MPLS packets.
ip netstream mpls [ label-positions label-position1 [ label-position2 [ label-position3 ] ] ] [ no-ip-fields ]
By default, statistics about MPLS packets are not collected.
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 1 minute.
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. Specify the processing method when the upper limit for cached entires is reached.
ip netstream max-entry { aging | disable-caching }
By default, the system will age out the oldest entries when the number of cached entries reaches the upper limit.
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 ] [ chassis chassis-number slot slot-number ]
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 this task
NetStream aggregation is implemented by software.
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 | bgp-community | 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-address 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. |
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 ] [ chassis chassis-number slot slot-number [ cpu cpu-number ] ] |
Display information about the NetStream data export. |
display ip netstream export [ chassis chassis-number slot slot-number [ cpu cpu-number ] ] |
Display NetStream template information. |
display ip netstream template [ chassis chassis-number slot slot-number [ cpu cpu-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 Router A to collect statistics on packets passing through Router A.
· Enable NetStream for incoming and outgoing traffic on GigabitEthernet 1/2/0/1.
· Configure the router 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/2/0/1.
<RouterA> system-view
[RouterA] interface gigabitethernet 1/2/0/1
[RouterA-GigabitEthernet1/2/0/1] ip netstream inbound
[RouterA-GigabitEthernet1/2/0/1] ip netstream outbound
[RouterA-GigabitEthernet1/2/0/1] quit
# Specify 12.110.2.2 as the IP address of the destination host and UDP port 5000 as the export destination port number.
[RouterA] ip netstream export host 12.110.2.2 5000
Verifying the configuration
# Display NetStream entry information.
[RouterA] display ip netstream cache
IP NetStream cache information:
Active flow timeout : 30 min
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 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 0 GE1/2/0/1(I) 5
IP 100.1.1.2 (1024) 10.1.1.1 (21) 1 0 GE1/2/0/1(O) 5
# Display information about the NetStream data export.
[RouterA] 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 Router A 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 AS, protocol-port, source-prefix, destination-prefix, and prefix.
· Export the aggregation data of different modes to 4.1.1.1, with UDP ports 2000, 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.
<RouterA> system-view
[RouterA] ip netstream export version 5 origin-as
# Enable NetStream for incoming and outgoing traffic on GigabitEthernet 1/2/0/1.
[RouterA] interface gigabitethernet 1/2/0/1
[RouterA-GigabitEthernet1/2/0/1] ip netstream inbound
[RouterA-GigabitEthernet1/2/0/1] ip netstream outbound
[RouterA-GigabitEthernet1/2/0/1] quit
# Specify 4.1.1.1 as the IP address of the destination host and UDP port 5000 as the export destination port number.
[RouterA] ip netstream export host 4.1.1.1 5000
# Set the aggregation mode to AS, and specify the destination host for the aggregation data export.
[RouterA] ip netstream aggregation as
[RouterA-ns-aggregation-as] enable
[RouterA-ns-aggregation-as] ip netstream export host 4.1.1.1 2000
[RouterA-ns-aggregation-as] quit
# Set the aggregation mode to protocol-port, and specify the destination host for the aggregation data export.
[RouterA] ip netstream aggregation protocol-port
[RouterA-ns-aggregation-protport] enable
[RouterA-ns-aggregation-protport] ip netstream export host 4.1.1.1 3000
[RouterA-ns-aggregation-protport] quit
# Set the aggregation mode to source-prefix, and specify the destination host for the aggregation data export.
[RouterA] ip netstream aggregation source-prefix
[RouterA-ns-aggregation-srcpre] enable
[RouterA-ns-aggregation-srcpre] ip netstream export host 4.1.1.1 4000
[RouterA-ns-aggregation-srcpre] quit
# Set the aggregation mode to destination-prefix, and specify the destination host for the aggregation data export.
[RouterA] ip netstream aggregation destination-prefix
[RouterA-ns-aggregation-dstpre] enable
[RouterA-ns-aggregation-dstpre] ip netstream export host 4.1.1.1 6000
[RouterA-ns-aggregation-dstpre] quit
# Set the aggregation mode to prefix, and specify the destination host for the aggregation data export.
[RouterA] ip netstream aggregation prefix
[RouterA-ns-aggregation-prefix] enable
[RouterA-ns-aggregation-prefix] ip netstream export host 4.1.1.1 7000
[RouterA-ns-aggregation-prefix] quit
Verifying the configuration
# Display information about the NetStream data export.
[RouterA] display ip netstream export
AS aggregation export information:
Flow source interface : Not specified
Flow destination VPN instance : Not specified
Flow destination IP address (UDP) : 4.1.1.1 (2000)
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)
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)