SkillPilotAI

sar – network statistics (2/2)

This second part of sar covers the IPv6 counters (IP6, EIP6, ICMP6, EICMP6, UDP6), Fibre Channel and softnet, then saved data files, output formatting and the CPU, memory, disk and power reports. It is the tool you reach for when you need both live rates and yesterday's history on a Linux box.

191.1 Why is it used?

  • sar (System Activity Reporter, sysstat package) samples kernel counters every interval and shows the difference as a per-second rate.
  • The same tool gives IPv6 traffic, IPv6/ICMPv6 errors, softnet drops, CPU, memory and disk, so one command covers most first-level triage.
  • With the sysstat service enabled it writes daily files in /var/log/sysstat/saDD, so you can look at last night's problem today.
  • Linux only: install with apt/dnf install sysstat. In the lab it runs in a container, so it reads the Docker VM's /proc, not the Windows PC.

191.2 How it works

Where sar reads the IPv6 counters
  1. 1.Client (fd00:191::20) sends ping -6 echo request through the Docker bridge

  2. 2.Server (fd00:191::10) sends the echo reply back; iperf3 -6 sends a UDP stream

  3. 3.For every packet the kernel increments counters in /proc/net/snmp6

  4. 4.SOFT reads /proc/net/softnet_stat the same way

  5. 5.Every interval sar takes the difference and prints it as a rate (per second)

Network counters are per network namespace: inside a container you see only that container's traffic

Terminal
docker network create --ipv6 \  --subnet 192.168.211.0/24 \  --subnet fd00:191::/64 n191-landocker run -d --name n191-server \  --network n191-lan --ip6 fd00:191::10 \  --memory 128m alpine:3.20 sleep 600docker run -d --name n191-client \  --network n191-lan --ip6 fd00:191::20 \  --memory 128m alpine:3.20 sleep 600apk add sysstat iperf3   # clientiperf3 -s -D             # serverping -6 -c 6 -i 0.5 fd00:191::10iperf3 -6 -c fd00:191::10 -u -b 1M -t 3sar -n IP6,EIP6,ICMP6,EICMP6,UDP6 1 3
Output
kernel modules before: 27 (mods-before.txt)### kernel modules after: 27 (mods-after.txt)before = after (no module loaded)
  • IPv6 is built into the kernel, so the module list stayed 27 before and after.
  • ping -6 sent 6 echo requests and got 6 replies; iperf3 sent 1 Mbit/s UDP for 3 s with no loss.

191.3 IPv6 keywords: IP6, EIP6, ICMP6, EICMP6, UDP6

KeywordFieldsWhat it countsKey fields
IP610IPv6 datagrams received, forwarded, delivered, sentirec6/s, idel6/s, orq6/s, fragcr6/s
EIP611IPv6 errorsi2big6/s (bigger than MTU), inort6/s/onort6/s (no route), idisc6/s
ICMP617ICMPv6 messages incl. echo, router and neighbor discoveryiechr6/s, onbsol6/s, inbad6/s
EICMP611ICMPv6 error messagesidtunr6/s (unreachable), itmex6/s, ipck2b6/s (packet too big)
UDP64UDP over IPv6idgm6/s, odgm6/s, noport6/s, idgmer6/s
Output
$ sar -n IP6,EIP6,ICMP6,EICMP6,UDP6 1 311:54:26      irec6/s fwddgm6/s   idel6/s    orq6/s  asmrq6/s  asmok6/s imcpck6/s omcpck6/s fragok6/s fragcr6/s11:54:27        12.00      0.00     11.00     75.00      0.00      0.00      1.00      1.00      0.00      0.0011:54:28         2.00      0.00      2.00     90.00      0.00      0.00      0.00      0.00      0.00      0.0011:54:29         2.00      0.00      2.00     89.00      0.00      0.00      0.00      0.00      0.00      0.00Average:         5.33      0.00      5.00     84.67      0.00      0.00      0.33      0.33      0.00      0.00
  • orq6/s was 75-90 per second because every iperf3 UDP datagram is a local send request; irec6/s shows the ping replies.
  • ICMP6: 2 echo replies per second, plus in the first second one neighbor solicitation out and one neighbor advertisement in (NDP = the ARP of IPv6).
  • EIP6 and EICMP6 stayed all 0.00 in the healthy lab. In production rising i2big6/ipck2b6 or no-route counters mean check MTU and routing.
  • IPv6 routers do not fragment, so packet-too-big counters are the signal for path MTU problems.
Output
11:54:26      idgm6/s   odgm6/s noport6/s idgmer6/s11:54:27         1.00     65.00      0.00      0.0011:54:28         0.00     88.00      0.00      0.0011:54:29         0.00     87.00      0.00      0.00Average:         0.33     80.00      0.00      0.00[  5]   0.00-3.00   sec   365 KBytes   998 Kbits/sec  0.000 ms  0/263 (0%)  sender
  • odgm6/s averaged 80 datagrams/s, close to the 87-88 per second that iperf3 itself reported (0/263 lost).

191.4 FC and SOFT

  • FC: frames and words per second of a Fibre Channel HBA (storage networks): FCHOST, fch_rxf/s, fch_txf/s, fch_rxw/s, fch_txw/s.
  • No FC card in the lab, /sys/class/fc_host is empty, so sar honestly says not available:
Output
$ ls /sys/class/fc_host$ sar -n FC 1 1Requested activities not available(exit 3)
  • SOFT = kernel software network processing (softnet): total/s, dropd/s (queue full), squeezd/s (softirq budget ran out), rx_rps/s, flw_lim/s, blg_len.
  • dropd and squeezd matter most. With 5 Mbit/s UDP about 1000 frames/s were processed, drops 0, but squeezd shows the budget ran out a few times.
Output
$ sar -n SOFT 1 311:54:30        CPU   total/s   dropd/s squeezd/s  rx_rps/s flw_lim/s   blg_len11:54:31        all    871.00      0.00      5.00      0.00      0.00         011:54:32        all   1126.00      0.00      4.00      0.00      0.00         011:54:33        all   1193.07      0.00     10.89      0.00      0.00         0Average:        all   1063.79      0.00      6.64      0.00      0.00         0

191.5 Interval, count, data files and formatting

Terminal
sar 1 5                 # 1 s gap, 5 samplessar 0                   # averages since bootsar -o /tmp/n191.sa 1 3 # save binary (all activities)sar -n ICMP6 -f /tmp/n191.sasar -1 -n EIP6 -s 22:00 -e 23:00   # yesterday's daily file, time windowsar -h -n DEV 1 1       # --pretty + --humansadf -d /tmp/n191.sa -- -n UDP6    # CSV (-j = JSON)
OptionMeaning
sar 1 5 / sar 2 / sar 05 samples 1 s apart / every 2 s until Ctrl+C / averages since boot
-o file, -Dsave binary with all activities; -D names it saYYYYMMDD
-f file, -1, -2read a saved file; yesterday / day before
-s, -e, -istart time (default 08:00), end time (default 18:00), record interval
-p / --human / -hIFACE column last / sizes like 1.2M / both together
-z, --dec=0|1|2omit idle devices, decimal places
sadf -d / -jsaved file to semicolon CSV / JSON; sar options go after --
Output
$ sadf -d /tmp/n191.sa -- -n UDP6# hostname;interval;timestamp;idgm6/s;odgm6/s;noport6/s;idgmer6/sclient;1;2026-11-09 11:54:34 UTC;0.00;0.00;0.00;0.00client;1;2026-11-09 11:54:35 UTC;0.00;0.00;0.00;0.00client;1;2026-11-09 11:54:36 UTC;0.00;0.00;0.00;0.00
Record and replay history
  1. 1.sysstat service (or sar -o file) runs sadc and saves all activities in binary

  2. 2.Daily file /var/log/sysstat/saDD keeps the day's samples

  3. 3.Next day: sar -1 -n EIP6 -s 22:00 -e 23:00 reads only last night's window

  4. 4.sadf -d file -- -n UDP6 turns it into CSV for scripts and dashboards

191.6 System reports: CPU, memory, disk, power

Terminal
sar -u 1 3        # %user %system %iowait %idlesar -P ALL 1 1    # one row per CPUsar -w 1 3        # proc/s, cswch/ssar -r 1 3        # memorysar -B / -S / -W  # paging / swap space / swappingsar -d / -F / -b  # per device / filesystems / total I/Osar -m CPU 1 1    # CPU MHz (power management)sar -A 1 1        # all activities
Output
$ sar -r 1 311:54:53    kbmemfree   kbavail kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit  kbactive   kbinact   kbdirty11:54:54      6477880   7098468    672428      8.36    107800    572352   1728180     17.04    280728    725084      1224
  • -u gives %user/%system/%iowait/%idle; -P ALL gave one row for each of the Docker VM's 8 CPUs.
  • -I SUM said 'Requested activities not available' in the container: sadc found no interrupt data.
  • kbmemfree is about 6 GB although the container limit is 128 MB, because -r reads the whole Docker VM's memory.
  • -y (TTY) and -m FAN were not available (no serial device, no fan sensor); -m CPU reported 2112 MHz.
  • sar -A 1 1 produced 275 lines for one snapshot; -V shows version, --sadc the collector path.

191.7 Common mistakes

  • Thinking sar in a container shows only the container: network counters are per namespace, but CPU/memory/disk show the whole VM.
  • Expecting history without enabling the sysstat service: no daily files, so -1 and -f have nothing to read.
  • Reading 'Requested activities not available' as a bug: it means the hardware or data (FC HBA, serial port, fan sensor) is not there.
  • Forgetting the -- before sar options in sadf (sadf -d file -- -n UDP6).
  • Ignoring squeezd/s: drops can be 0 while the softirq budget is still being exhausted.

191.8 Interview tips

  • Slow IPv6: check rate with -n IP6,UDP6, then too-big and no-route in EIP6/EICMP6.
  • If errors are zero, look at -n SOFT (dropd, squeezd) and -u for CPU.
  • For last night: sar -1 -n EIP6 -s 22:00 -e 23:00, then sadf -d for a report.
  • IPv6 routers never fragment, so packet-too-big counters point at path MTU issues.
  • Remember: E-keywords = errors; FC needs an HBA; container reports for CPU/mem/disk = whole VM.