solaris.pro / Field manuals / DTrace

DTrace cookbook: network diagnosis

Trace network-related syscalls and combine kernel observations with Solaris networking tools.

Scope: Oracle Solaris 11.4 and, for LDoms, compatible SPARC hardware with Oracle VM Server for SPARC. Examples are educational: verify release, privileges, target names and backups before running changes.

How it works

Network debugging is layered

Confirm physical link, IP address, route and name resolution before tracing packet paths.

Use portable observations first

Network provider names can differ; syscall tracing and built-in network tools give a reliable first pass.

Avoid payload capture

Tracing network data can expose secrets. Aggregate metadata unless packet contents are essential and authorized.

Worked examples

Each example explains the question it answers, a reproducible starting point, what to look for, and operational precautions.

1. Count send and receive syscalls

Identify chatty processes.

syscall::send*:entry { @send[execname] = count(); }
syscall::recv*:entry { @recv[execname] = count(); }

Interpretation: Probe wildcards match available syscall names; compare against `netstat -s`.

Operational note: Run commands in a test environment first; confirm device names, privileges and release-specific options.

2. Time connect attempts

Find slow outbound connection establishment.

syscall::connect:entry { self->t = timestamp; }
syscall::connect:return /self->t/
{
  @connect_ns[execname] = quantize(timestamp-self->t);
  self->t = 0;
}

Interpretation: Latency includes syscall time; application-level connection readiness may extend beyond the return.

Operational note: Run commands in a test environment first; confirm device names, privileges and release-specific options.

3. Check IP state

Rule out ordinary configuration errors.

dladm show-phys
ipadm show-addr
netstat -rn
netstat -s

Interpretation: Validate interface/link/route counters before interpreting DTrace output.

Operational note: Run commands in a test environment first; confirm device names, privileges and release-specific options.

Before you finish

  • Use capture policies that protect user data and credentials.

Primary documentation

Read the relevant Oracle documentation for exact version-specific flags, supported platforms and limitations: Oracle primary reference ↗.

This field manual is independent, not affiliated with or endorsed by Oracle. Command examples should be adapted to your environment.