System Administration Guide: Network Interfaces and Network Virtualization

Gathering Usage Statistics for VNICs and Flows

Network virtualization and resource control introduces tools for observing traffic on a per-interface or per-flow basis. The next tasks show how to use options of the dladm and flowadm commands to obtain statistics on packet traffic. For full details on each command, refer to the following man pages:

ProcedureHow to Obtain Statistics on VNICs

VNIC statistics are useful for provisioning purposes, such as determining whether a system needs additional VNICs or possibly additional interfaces. You can also use VNIC traffic statistics to determine how well network consolidation onto a virtual network is working.

Before You Begin

The task assumes that you have a working virtual network, such as the network configured in Configuring a Basic Virtual Network.

  1. On the system where you create the virtual network, become superuser or assume the equivalent root role in the global zone.

    To create and assign the root role, see How to Make root User Into a Role in System Administration Guide: Security Services.

  2. Observe traffic flow over network interfaces

    Before checking the flow usage on individual VNICs, you might want to view overall usage of the VNIC's underlying interface.

    where link-name is the name of a currently plumbed interface, for example internal0.


    # dladm show-link -s -i 5 internal0
    LINK        IPACKETS  RBYTES      IERRORS  OPACKETS  OBYTES      OERRORS
    internal0   5315127   400738164         0   169526   29260024         0
    LINK        IPACKETS  RBYTES      IERRORS  OPACKETS  OBYTES      OERRORS
    internal0         1          60         0        2        340         0
    LINK        IPACKETS  RBYTES      IERRORS  OPACKETS  OBYTES      OERRORS
    internal0        17        1020         0        4        456         0
    ^C

    To halt the display, press Ctrl-C.

  3. Observe traffic flow over configured VNICs.

    Use the following syntax for each VNIC in the virtual network. You must run this command in the global zone for all VNICs configured on the system.


    #  dladm show-link -s -i 5 vnic-link-name
     
    

    where vnic-name is the name of the VNIC whose traffic you want to observe.

    You should receive output similar to the following:


    # dladm show-link -s -i 5 vnic0
                ipackets  rbytes      ierrors   opackets      obytes      oerrors
    vnic0       537001    48104701    0         5             210         0
                ipackets  rbytes      ierrors   opackets      obytes      oerrors
    vnic0       3         270         0         0             0           0
    ^C

    The output indicates that vnic0 has had both incoming packet (ipackets) and outgoing packet (opackets) traffic.

    To halt the display, press Ctrl-C.

ProcedureHow to Obtain Statistics on Flows

Flow statistics help you evaluate packet traffic on your network before assigning bandwidth and priorities to already configured flows. Like VNIC statistical information, flow statistics are also useful for provisioning and, possibly, for billing purposes.

Before You Begin

This procedure assumes that you have configured flows, as described in Chapter 13, Configuring Resource Management on an Interface.

  1. On the system where you configure flow control, become superuser or assume the equivalent root role in the global zone.

    To create and assign the root role, see How to Make root User Into a Role in System Administration Guide: Security Services.

  2. Observe packet flow statistics for a system that is configured with interface-based flow control.

    The following example shows output for a system with two network interfaces that uses traditional bandwidth control. The system does not have a virtual network configured.


    # flowadm show-flow -s
    FLOW        IPACKETS  RBYTES      IERRORS OPACKETS  OBYTES      OERRORS
    net20       0         0           0       1723      72366       0
    httpsflow   0         0           0       32932     3225851     0
    httpflow    29        3982        0       42        20799       0

    where

    net20

    is a flow for all UDP traffic across interface 10.10.3.20/24 on the internal network.

    httpsflow

    is a flow for all secure HTTP traffic over interface 192.168.3.25 , which is connected to the external network

    httpflow

    is a flow for all HTTP traffic over interface 192.168.3.25.

  3. To halt the display, press Ctrl-C.