Example for Collecting Statistics About IPv4 Flows Aggregated Based on the AS Number

This section provides an example for configuring NetStream to collect statistics about IPv4 flows aggregated based on the AS number. NetStream allows flows to be aggregated based on the AS number, which makes accounting or management easier.

Networking Requirements

On the network shown in Figure 1, Device D connects network A and network B to the wide area network (WAN). Device D samples and aggregates flows before sending them to the NetStream Collector (NSC).

Figure 1 Networking diagram for collecting statistics about IPv4 flows aggregated based on the AS number
  • Interfaces 1 through 4 in this example represent GE 0/1/0, GE 0/1/8, GE 0/1/16, and GE 0/1/24, respectively.

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure reachable routes between the egress router of the LAN and the WAN.

  2. Configure reachable routes between the ingress router of the LAN and the NSC.

  3. Configure the ingress router of the LAN to sent traffic statistics to the specified NSC.

  4. Configure the ingress router of the LAN to sent traffic statistics to the inbound interface on the NSC.

  5. Aggregate sampled flows to reduce the data sent to the NSC.

  6. Enable NetStream on the inbound interface of the ingress router.

Data Preparation

To complete the configuration, you need the following data:

  • IP address of each interface

  • IP address of the NSC

  • Output format of NetStream flows

  • NetStream sampling ratio

  • ID of the slot where the NetStream service processing board resides (In this example, the NetStream service processing board is in slot 1.)

Procedure

  1. Configure IP addresses for each router. (The configuration details are not provided here.)
  2. Configure reachable routes between the WAN, Device A, and Device B.

    # Configure reachable routes between Device A and Device D.

    [*DeviceA] ip route-static 1.1.1.1 24 GigabitEthernet 0/1/0
    [*DeviceA] commit

    # Configure reachable routes between Device B and Device D.

    [*DeviceB] ip route-static 1.1.1.1 24 GigabitEthernet 0/1/0
    [*DeviceB] commit

  3. Configure reachable routes between Device D and the NSC.

    # Configure reachable routes between Device D and Device C.

    [*DeviceD] ip route-static 2.2.2.1 24 3.3.3.2

  4. Enable NetStream on Device D.

    # Specify the distributed NetStream sampling mode on a board.
    [*DeviceD] slot 1
    [*DeviceD-slot-1] ip netstream sampler to slot self
    [*DeviceD-slot-1] quit

    # Enable NetStream statistics collection for incoming traffic.

    [*DeviceD] interface gigabitethernet 0/1/16
    [*DeviceD-GigabitEthernet0/1/16] ip netstream inbound

    NetStream enabled on a main interface cannot collect traffic statistics about its sub-interface.

    # Output aggregated flows in V9 format.

    [*DeviceD] ip netstream aggregation as
    [*DeviceD-aggregation-as] enable
    [*DeviceD-aggregation-as] ip netstream export host 2.2.2.1 3000
    [*DeviceD-aggregation-as] ip netstream export source 3.3.3.1
    [*DeviceD-aggregation-as] export version 9

    # Enable the NetStream packet sampling function.

    [*DeviceD-GigabitEthernet0/1/16] ip netstream sampler fix-packets 1000 inbound
    [*DeviceD-GigabitEthernet0/1/16] quit
    [*DeviceD] commit

  5. Verify the configuration.

    # Check whether flows are output on the router.

    [~DeviceB] display ip netstream cache as slot 1
     DstIf   
     SrcIf  
     DstAs      Streams    Packets    Direction     SrcAs   
    --------------------------------------------------------------------------
     GI0/1/8        
     Unknown         
     0          985988     985988     out           0

Configuration Files

  • Device A configuration file

    #
     sysname DeviceA
    #
    interface GigabitEthernet0/1/0
     ip address 172.16.0.1 255.255.255.0
    #
    ip route-static 1.1.1.1 255.255.255.0 GigabitEthernet0/1/0
    #
    return
  • Device B configuration file

    #
     sysname DeviceB
    #
    interface GigabitEthernet0/1/0
     ip address 172.17.1.1 255.255.255.0
    #
    ip route-static 1.1.1.1 255.255.255.0 GigabitEthernet0/1/0
    #
    return
  • Device C configuration file
    #
     sysname DeviceC
    #
    interface GigabitEthernet0/1/0
     ip address 3.3.3.2 255.255.255.0
    #
    return
  • Device D configuration file

    # 
    slot 1
     ip netstream sampler to slot self
    #
     sysname DeviceD
    #
    interface GigabitEthernet0/1/0
     ip address 172.16.0.2 255.255.255.0 
    #
    interface GigabitEthernet0/1/8
     ip address 172.17.1.2 255.255.255.0 
    #
    interface GigabitEthernet0/1/16
     ip address 1.1.1.1 255.255.255.0
     ip netstream inbound
     ip netstream sampler fix-packets 1000 inbound
    #
    interface GigabitEthernet0/1/24
     ip address 3.3.3.1 255.255.255.0
    #
    ip netstream aggregation as
     enable
     export version 9
     ip netstream export source 3.3.3.1
     ip netstream export host 2.2.2.1 3000
    #
    return
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >