DTRACE_SCTP(4)
π NAME π
okay bestie, welcome to DTRACE_SCTP β she lives in section 4 of the Kernel Interfaces Manual, and she is literally a DTrace provider for tracing all the events related to the sctp(4) protocol π¦β¨
πΈ SYNOPSIS πΈ
here's the whole cast of probes, no skips, no cuts π
sctp:cwnd::init(uint32_t, uint32_t, uintptr_t, int, int);
sctp:cwnd::ack(uint32_t, uint32_t, uintptr_t, int, int);
sctp:cwnd::rttvar(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t);
sctp:cwnd::rttstep(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t);
sctp:cwnd::fr(uint32_t, uint32_t, uintptr_t, int, int);
sctp:cwnd::to(uint32_t, uint32_t, uintptr_t, int, int);
sctp:cwnd::bl(uint32_t, uint32_t, uintptr_t, int, int);
sctp:cwnd::ecn(uint32_t, uint32_t, uintptr_t, int, int);
sctp:cwnd::pd(uint32_t, uint32_t, uintptr_t, int, int);
sctp:rwnd:assoc:val(uint32_t, uint32_t, int, int);
sctp:flightsize:net:val(uint32_t, uint32_t, uintptr_t, int, int);
sctp:flightsize:assoc:val(uint32_t, uint32_t, int, int);
sctp:::receive(pktinfo_t *, csinfo_t *, ipinfo_t *, sctpsinfo_t *,
sctpinfo_t *);
sctp:::send(pktinfo_t *, csinfo_t *, ipinfo_t *, sctpsinfo_t *,
sctpinfo_t *);
sctp:::state-change(void *, csinfo_t *, void *, sctpsinfo_t *, void *,
sctplsinfo_t *);
β¨ DESCRIPTION β¨
so the DTrace sctp provider lets you trace events inside the sctp(4) protocol implementation π
she's giving very much the same energy as the dtrace_ip(4) and dtrace_udp(4) providers, except she also serves up probes for protocol events that happen at a level way above plain packet reception and transmission. main character behavior fr fr π
the sctp:cwnd::() probes track changes in the congestion window on a netp. the sctp:rwnd::() probes track changes in the receiver window for an assoc. the sctp:flightsize:net:val() probe tracks changes in the flight size on a net or assoc, and the sctp:flightsize:assoc:val() probe provides the total flight version π«
the arguments of all sctp probes except for sctp:cwnd::rtt*() and sctp::assoc:val() are: the Vtag for this end, the port number of the local side, the pointer to struct sctp_nets *changing, the old value of the cwnd, and the new value of the cwnd π
the arguments of sctp:::val() are similar to the above, except the fourth argument is the up/down amount ππ
the sctp:cwnd::rtt*() probe arguments are:
- a bitmap of
Vtag << 32 | localport << 16 | remoteport - a bitmap of
obw | nbw - a bitmap of
bwrtt | newrtt flight- and a bitmap of
(cwnd << 32) | point << 16 | retval(0/1)
the sctp:cwnd::init() probe fires when a remotely-initiated active SCTP open succeeds π at that point the new connection is in the ESTABLISHED state, and the probe arguments expose the headers associated with the final ACK of the four-way handshake π€
the sctp:::send() and sctp:::receive() probes fire when the host sends or receives an SCTP packet, respectively. and just like with the dtrace_udp(4) provider, sctp probes fire only for packets sent by or to the local host β forwarded packets get handled in the IP layer and are only visible to the dtrace_ip(4) provider, no cap π
the sctp:::state-change() probe fires upon local SCTP association state transitions. its first, third and fifth arguments are currently always NULL. its last argument describes the from-state in the transition, and the to-state can be obtained from args[3]->sctps_state π
π FILES π
/usr/lib/dtrace/sctp.dβ DTrace type and translator definitions for the sctp provider πΎ
π EXAMPLES π
a script that logs SCTP packets in real time π:
#pragma D option quiet
#pragma D option switchrate=10hz
dtrace:::BEGIN
{
printf(" %3s %15s:%-5s %15s:%-5s0, "CPU",
"LADDR", "LPORT", "RADDR", "RPORT");
}
sctp:::send
{
printf(" %3d %16s:%-5d -> %16s:%-5d0, cpu,
args[2]->ip_saddr, args[4]->sctp_sport,
args[2]->ip_daddr, args[4]->sctp_dport);
}
sctp:::receive
{
printf(" %3d %16s:%-5d <- %16s:%-5d0, cpu,
args[2]->ip_daddr, args[4]->sctp_dport,
args[2]->ip_saddr, args[4]->sctp_sport);
}
a script that logs SCTP association state changes as they occur π¦:
#pragma D option quiet
#pragma D option switchrate=10
int last[int];
dtrace:::BEGIN
{
printf(" %3s %12s %-25s %-25s0,
"CPU", "DELTA(us)", "OLD", "NEW");
}
sctp:::state-change
/ last[args[1]->cs_cid] /
{
this->elapsed = (timestamp - last[args[1]->cs_cid]) / 1000;
printf(" %3d %12d %-25s -> %-25s0, cpu, this->elapsed,
sctp_state_string[args[5]->sctps_state],
sctp_state_string[args[3]->sctps_state]);
last[args[1]->cs_cid] = timestamp;
}
sctp:::state-change
/ last[args[1]->cs_cid] == 0 /
{
printf(" %3d %12s %-25s -> %-25s0, cpu, "-",
sctp_state_string[args[5]->sctps_state],
sctp_state_string[args[3]->sctps_state]);
last[args[1]->cs_cid] = timestamp;
}
π COMPATIBILITY π
the sctp:::send(), sctp:::receive(), and sctp:::state-change() probes are compatible with the sctp provider in Solaris β¨ all the other probes are only available in FreeBSD π§
π SEE ALSO π
dtrace(1), dtrace_ip(4), dtrace_udp(4), dtrace_udplite(4), sctp(4), SDT(9)
π AUTHORS π
this manual page was written by Devin Teske <dteske@FreeBSD.org> π«Ά
and that's the whole page bestie, you ate that π this one shipped from Debian, dated August 22, 2018 β go trace some packets, ily, periodt πβ¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2018 Devin Teske <dteske@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms