7.11. ICMP StatisticsICMP statistics are maintained by Solaris in the same way as TCP and IP, as explained in the previous two sections. To avoid unnecessary repetition, we list only key points and differences in this section. The MIB-II statistics are in /etc/sma/snmp/mibs/IP-MIB.txt and in RFC 2011, along with IP. Solaris has a few additions to the ICMP MIB. 7.11.1. ICMP Statistics from KstatThe following command prints all of the ICMP MIB statistics. $ kstat -n icmp module: ip instance: 0 name: icmp class: mib2 crtime 3.207830752 inAddrMaskReps 0 inAddrMasks 0 ... 7.11.2. ICMP Statistics ReferenceTable 7.4 from mib2.h lists ICMP MIB-II statistics plus Solaris additions.
7.11.3. ICMP Statistics from DTraceThe following DTrace one-liner tracks ICMP MIB events. # dtrace -n 'mib:::icmp* { @[probename] = sum(arg0); }' dtrace: description 'mib:::icmp* ' matched 34 probes ^C icmpInEchoReps 1 icmpInEchos 3 icmpOutEchoReps 3 icmpOutMsgs 3 icmpInMsgs 4 7.11.4. Tracing Raw Network FunctionsThe fbt provider traces raw kernel functions, but its use is not recommended, because kernel functions may change between minor releases of Solaris, breaking DTrace scripts that used them. On the other hand, being able to trace these events is certainly better than not having the option at all. The following example counts the frequency of TCP/IP functions called for this demonstration. # dtrace -n 'fbt:ip::entry { @[probefunc] = count(); }' dtrace: description 'fbt:ip::entry ' matched 1757 probes ^C ... ip_cksum 519 tcp_wput_data 3058 tcp_output 3165 tcp_wput 3195 squeue_enter 3203 This one-liner matched 1, 757 probes for this build of Solaris 10 (the number of matches will vary for other builds). Another line of attack is the network driver itself. Here we demonstrate hme. # dtrace -n 'fbt:hme::entry { @[probefunc] = count(); }' dtrace: description 'fbt:hme::entry ' matched 100 probes ^C ... hmewput 221 hmeintr 320 hme_check_dma_handle 668 hme_check_acc_handle 762 The 100 probes provided by this hme driver may be sufficient for the task at hand and are easier to use than 1, 757 probes. rtls provides even fewer probes, 33. |