Example for Collecting IPv6 Original Flow Statistics
This section provides an example for collecting IPv6 original flow statistics. NetStream enabled on a network can collect network flow statistics.
Networking Requirements
As the Internet rapidly develops, ISP networks support increasing bandwidth and planned QoS parameters, and carriers need to provide more delicate management and accounting services. NetStream monitoring configured on an NetStream Data Exporter (NDE) allows the NDE to send traffic statistics collected on specified interfaces to specified NetStream Collectors (NSCs) for analysis, which achieves interface-specific service monitoring.
On the network shown in Figure 3-21, Device A and Device B reside on different IPv6 networks. GE 0/1/0 and GE 0/2/0 connect Device C to Device A and Device B, respectively. Traffic statistics are collected on Device C and sent to NSC1 and NSC2 after traffic is aggregated.
To collect flow-specific statistics, configure NetStream monitoring services in the inbound direction of GE 0/1/0 and GE 0/2/0 on Device C. Traffic statistics collected on GE 0/1/0 are sent to NMS1 with an IPv4 address and traffic statistics collected on GE 0/2/0 are sent to NMS2 with an IPv6 address.
Configuration Roadmap
The configuration roadmap is as follows:
Assign an IP address to each interface on each router.
Configure NetStream statistics on Device C.
Configure NetStream monitoring services on Device C.
Data Preparation
To complete the configuration, you need the following data:
IP address of each interface on each router
Version of the NetStream packet format
Source and destination addresses, destination port number, and monitoring view for NetStream packets
Slot ID for a NetStream service processing board (for example, slot 1)
Procedure
- Assign an IP address to each interface on each router. For configuration details, see Configuration Files in this section.
- Configure NetStream statistics on Device C.
# Specify the distributed NetStream service processing mode on an interface board.
[*DeviceC] slot 1 [*DeviceC-slot-1] ipv6 netstream sampler to slot self [*DeviceC-slot-1] quit
# Collect statistics about original flows based on TCP flags.
[*DeviceC]ipv6 netstream tcp-flag enable
# Configure the NetStream sampling function and set the mode to fixed packet sampling.
[*DeviceC] ipv6 netstream sampler fix-packets 10000 inbound
# Configure NetStream to collect statistics about incoming flows on GE 0/1/0 and GE 0/2/0.
[*DeviceC] interface GigabitEthernet0/1/0 [*DeviceC-GigabitEthernet0/1/0] undo shutdown [*DeviceC-GigabitEthernet0/1/0] ipv6 netstream inbound [*DeviceC-GigabitEthernet0/1/0] quit [*DeviceC] interface GigabitEthernet0/2/0 [*DeviceC-GigabitEthernet0/2/0] undo shutdown [*DeviceC-GigabitEthernet0/2/0] ipv6 netstream inbound [*DeviceC-GigabitEthernet0/2/0] quit
- Configure NetStream monitoring services.
[*DeviceC] ipv6 netstream monitor monitor1 [*DeviceC-monitor-monitor1] ipv6 netstream export host 192.168.0.2 6000 [*DeviceC-monitor-monitor1] quit [*DeviceC] ipv6 netstream monitor monitor2 [*DeviceC-monitor-monitor2] ipv6 netstream export host ipv6 2001:db8:100::1 6000 [*DeviceC] interface gigabitethernet 0/1/0 [*DeviceC-GigabitEthernet0/1/0] ipv6 netstream monitor monitor1 inbound [*DeviceC-GigabitEthernet0/1/0] quit [*DeviceC] interface gigabitethernet 0/2/0 [*DeviceC-GigabitEthernet0/2/0] ipv6 netstream monitor monitor2 inbound [*DeviceC-GigabitEthernet0/2/0] quit [*DeviceC] commit
- Verify the configuration.
Run the display ipv6 netstream monitor all command to view information about all NetStream monitoring services.
[~DeviceC] display ipv6 netstream monitor all Monitor monitor1 ID : 1 AppCount : 1 Address Port 192.168.0.2 6000 ------------------------------------------------------------ Monitor monitor2 ID : 2 AppCount : 1 Address Port 2001:db8:100::1 6000 ------------------------------------------------------------
# Run the display ipv6 netstream cache origin slot 1 command to view all types of NetStream original flows in the buffer.
[~DeviceC] display ipv6 netstream cache origin slot 1 Show information of IP and MPLS cache of slot 1 is starting. get show cache user data success. DstIf DstIP SrcIP Pro Tos Flags Packets SrcIf DstP Msk SrcP Msk NextHop DstAs SrcAs BGP: BGP NextHop TopLabelType Direction Label1 Exp1 Bottom1 Label2 Exp2 Bottom2 Label3 Exp3 Bottom3 TopLabelIpAddress -------------------------------------------------------------------------- Null 1:1::1:1 2:2::2:2 1 1 0 2746 GI0/3/0 0 32 0 24 3:3::3:3 0 0 0:0::0:0 0 in 0 0 0 0 0 0 0 0 0 0:0::0:0
Configuration Files
Device A configuration file
# sysname DeviceA # interface GigabitEthernet0/1/0 undo shutdown ipv6 enable ipv6 address 2001:db8:200::2/96 # return
Device B configuration file
# sysname DeviceB # interface GigabitEthernet0/1/0 undo shutdown ipv6 enable ipv6 address 2001:db8:300::2/96 # return
Device C configuration file
# sysname Device C # ipv6 netstream tcp-flag enable ip netstream sampler fix-packets 10000 inbound # ip netstream monitor monitor1 ipv6 netstream export host 192.168.0.1 6000 # ip netstream monitor monitor2 ipv6 netstream export host ipv6 2001:db8:100::1 6000 # interface GigabitEthernet0/1/0 undo shutdown ipv6 enable ipv6 address 2001:db8:200::1/96 # interface GigabitEthernet0/2/0 undo shutdown ipv6 enable ipv6 address 2001:db8:300::1/96 # interface GigabitEthernet0/1/0 ipv6 netstream inbound ipv6 netstream monitor monitor1 inbound # interface GigabitEthernet0/2/0 ipv6 netstream inbound ipv6 netstream monitor monitor2 inbound # slot 1 ipv6 netstream sampler to slot self # return