7.10. IP StatisticsAs 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:
7.10.1. IP Statistics InternalsThe 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 KstatThe 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 ReferenceTable 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.
7.10.4. IP Statistics from DTraceAs 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 |