Section 7.10. IP Statistics


7.10. IP Statistics

As with TCP statistics, Solaris maintains a large number of statistics in the IP code for SNMP MIB-II. These often exclude loopback traffic and may be a better indicator of physical network activity than are the TCP statistics. They can also help with troubleshooting as various packet errors are tracked. The IP statistics can be found in the following places:

  • IP MIB-II statistics, listed in /etc/sma/snmp/mibs/IP-MIB.txt on Solaris 10 or in RFC 2011; available from both the SNMP daemon and Kstat.

  • Solaris additions to IP MIB-II, listed in /usr/include/inet/mib2.h and available from Kstat.

  • Extra Kstat collections maintained by the module.

7.10.1. IP Statistics Internals

The IP MIB statistics are maintained in the Solaris code in the same way as the TCP MIB statistics (see Section 7.9.1). The Solaris code also maintains additional IP statistics to extend MIB-II.

7.10.2. IP Statistics from Kstat

The kstat command can fetch all the IP MIB statistics as follows.

$ kstat -n ip module: ip                              instance: 0 name:   ip                              class:    mib2         addrEntrySize                   96         crtime                          3.207689216         defaultTTL                      255         forwDatagrams                   0         forwProhibits                   0         forwarding                      2         fragCreates                     0 ... 


You can print all Kstats from the IP module by using -m instead of -n. The -m option includes extra Kstats that are not related to the Solaris IP MIB. You can print individual statistics with -s.

7.10.3. IP Statistics Reference

Table 7.3 lists all the IP MIB-II statistics and the Solaris additions. This list was taken from mib2.h. See TCP-MIB.txt for more information about some of these statistics.

Table 7.3. IP Kstat/MIB-II Statistics

Statistic

Description

ipForwarding

Forwarder? 1 = gateway; 2 = not gateway

ipDefaultTTL

Default time-to-live for IPH

ipInReceives

# of input datagrams

ipInHdrErrors

# of datagram discards for IPH error

ipInAddrErrors

# of datagram discards for bad address

ipForwDatagrams

# of datagrams being forwarded

ipInUnknownProtos

# of datagram discards for unknown protocol

ipInDiscards

# of datagram discards of good datagrams

ipInDelivers

# of datagrams sent upstream

ipOutRequests

# of outdatagrams received from upstream

ipOutDiscards

# of good outdatagrams discarded

ipOutNoRoutes

# of outdatagram discards: no route found

ipReasmTimeout

Seconds received fragments held for reassembly.

ipReasmReqds

# of IP fragments needing reassembly

ipReasmOKs

# of datagrams reassembled

ipReasmFails

# of reassembly failures (not datagram count)

ipFragOKs

# of datagrams fragmented

ipFragFails

# of datagram discards for no fragmentation set

ipFragCreates

# of datagram fragments from fragmentation

ipAddrEntrySize

Size of mib2_ipAddrEntry_t

ipRouteEntrySize

Size of mib2_ipRouteEntry_t

ipNetToMediaEntrySize

Size of mib2_ipNetToMediaEntry_t

ipRoutingDiscards

# of valid route entries discarded

...

/*The following defined in MIB-II as part of TCP and UDP groups */

tcpInErrs

Total # of segments received with error

udpNoPorts

# of received datagrams not deliverable (no application.)

...

/* In addition to MIB-II */

ipInCksumErrs

# of bad IP header checksums

ipReasmDuplicates

# of complete duplicates in reassembly

ipReasmPartDups

# of partial duplicates in reassembly

ipForwProhibits

# of packets not forwarded for administrative reasons

udpInCksumErrs

# of UDP packets with bad UDP checksums

udpInOverflows

# of UDP packets dropped because of queue overflow

rawipInOverflows

# of RAW IP packets (all IP protocols except UDP, TCP, and ICMP) dropped because of queue overflow

...

/* The following are private IPSEC MIB */

ipsecInSucceeded

# of incoming packets that succeeded with policy checks

ipsecInFailed

# of incoming packets that failed policy checks

ipMemberEntrySize

Size of ip_member_t

ipInIPv6

# of IPv6 packets received by IPv4 and dropped

ipOutIPv6

# of IPv6 packets transmitted by ip_wput

ipOutSwitchIPv6

# of times ip_wput has switched to become ip_wput_v6


7.10.4. IP Statistics from DTrace

As with TCP, DTrace can trace these statistics as they are updated. The following command lists the probes that correspond to IP MIB statistics whose name begins with "ip" (which is not quite all of them; see Table 7.3).

# dtrace -ln 'mib:ip::ip*'    ID   PROVIDER            MODULE                          FUNCTION NAME   691        mib                ip                  ndp_input_advert ipv6IfIcmpInBad...   692        mib                ip                 ndp_input_solicit ipv6IfIcmpInBad...   693        mib                ip                ill_frag_free_pkts ipReasmFails   694        mib                ip                  ill_frag_timeout ipReasmFails   695        mib                ip                  ill_frag_timeout ipv6ReasmFails   697        mib                ip                   ip_wput_frag_v6 ipv6OutFragOKs ... 


And the following one-liner tracks these statistics until Ctrl-C is pressed.

# dtrace -n 'mib:::ip* { @[probename] = sum(arg0); }' dtrace: description 'mib:::ip* ' matched 209 probes ^C   ipInDelivers                                                      6   ipInReceives                                                     91   ipOutRequests                                                   153 





Solaris Performance and Tools(c) Dtrace and Mdb Techniques for Solaris 10 and Opensolaris
Solaris Performance and Tools: DTrace and MDB Techniques for Solaris 10 and OpenSolaris
ISBN: 0131568191
EAN: 2147483647
Year: 2007
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net