1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
|
<table class="head">
<tr>
<td class="head-ltitle">DTRACE_SCTP(4)</td>
<td class="head-vol">Device Drivers Manual</td>
<td class="head-rtitle">DTRACE_SCTP(4)</td>
</tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">dtrace_sctp</code> — <span class="Nd">a
DTrace provider for tracing events related to the <a class="Xr">sctp(4)</a>
protocol</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="Fn">sctp:cwnd::init</code>(<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uintptr_t</var>,
<var class="Fa" style="white-space: nowrap;">int</var>,
<var class="Fa" style="white-space: nowrap;">int</var>);</p>
<p class="Pp"><code class="Fn">sctp:cwnd::ack</code>(<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uintptr_t</var>,
<var class="Fa" style="white-space: nowrap;">int</var>,
<var class="Fa" style="white-space: nowrap;">int</var>);</p>
<p class="Pp"><code class="Fn">sctp:cwnd::rttvar</code>(<var class="Fa" style="white-space: nowrap;">uint64_t</var>,
<var class="Fa" style="white-space: nowrap;">uint64_t</var>,
<var class="Fa" style="white-space: nowrap;">uint64_t</var>,
<var class="Fa" style="white-space: nowrap;">uint64_t</var>,
<var class="Fa" style="white-space: nowrap;">uint64_t</var>);</p>
<p class="Pp"><code class="Fn">sctp:cwnd::rttstep</code>(<var class="Fa" style="white-space: nowrap;">uint64_t</var>,
<var class="Fa" style="white-space: nowrap;">uint64_t</var>,
<var class="Fa" style="white-space: nowrap;">uint64_t</var>,
<var class="Fa" style="white-space: nowrap;">uint64_t</var>,
<var class="Fa" style="white-space: nowrap;">uint64_t</var>);</p>
<p class="Pp"><code class="Fn">sctp:cwnd::fr</code>(<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uintptr_t</var>,
<var class="Fa" style="white-space: nowrap;">int</var>,
<var class="Fa" style="white-space: nowrap;">int</var>);</p>
<p class="Pp"><code class="Fn">sctp:cwnd::to</code>(<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uintptr_t</var>,
<var class="Fa" style="white-space: nowrap;">int</var>,
<var class="Fa" style="white-space: nowrap;">int</var>);</p>
<p class="Pp"><code class="Fn">sctp:cwnd::bl</code>(<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uintptr_t</var>,
<var class="Fa" style="white-space: nowrap;">int</var>,
<var class="Fa" style="white-space: nowrap;">int</var>);</p>
<p class="Pp"><code class="Fn">sctp:cwnd::ecn</code>(<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uintptr_t</var>,
<var class="Fa" style="white-space: nowrap;">int</var>,
<var class="Fa" style="white-space: nowrap;">int</var>);</p>
<p class="Pp"><code class="Fn">sctp:cwnd::pd</code>(<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uintptr_t</var>,
<var class="Fa" style="white-space: nowrap;">int</var>,
<var class="Fa" style="white-space: nowrap;">int</var>);</p>
<p class="Pp"><code class="Fn">sctp:rwnd:assoc:val</code>(<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">int</var>,
<var class="Fa" style="white-space: nowrap;">int</var>);</p>
<p class="Pp"><code class="Fn">sctp:flightsize:net:val</code>(<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uintptr_t</var>,
<var class="Fa" style="white-space: nowrap;">int</var>,
<var class="Fa" style="white-space: nowrap;">int</var>);</p>
<p class="Pp"><code class="Fn">sctp:flightsize:assoc:val</code>(<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">uint32_t</var>,
<var class="Fa" style="white-space: nowrap;">int</var>,
<var class="Fa" style="white-space: nowrap;">int</var>);</p>
<p class="Pp"><code class="Fn">sctp:::receive</code>(<var class="Fa" style="white-space: nowrap;">pktinfo_t
*</var>, <var class="Fa" style="white-space: nowrap;">csinfo_t *</var>,
<var class="Fa" style="white-space: nowrap;">ipinfo_t *</var>,
<var class="Fa" style="white-space: nowrap;">sctpsinfo_t *</var>,
<var class="Fa" style="white-space: nowrap;">sctpinfo_t *</var>);</p>
<p class="Pp"><code class="Fn">sctp:::send</code>(<var class="Fa" style="white-space: nowrap;">pktinfo_t
*</var>, <var class="Fa" style="white-space: nowrap;">csinfo_t *</var>,
<var class="Fa" style="white-space: nowrap;">ipinfo_t *</var>,
<var class="Fa" style="white-space: nowrap;">sctpsinfo_t *</var>,
<var class="Fa" style="white-space: nowrap;">sctpinfo_t *</var>);</p>
<p class="Pp"><code class="Fn">sctp:::state-change</code>(<var class="Fa" style="white-space: nowrap;">void
*</var>, <var class="Fa" style="white-space: nowrap;">csinfo_t *</var>,
<var class="Fa" style="white-space: nowrap;">void *</var>,
<var class="Fa" style="white-space: nowrap;">sctpsinfo_t *</var>,
<var class="Fa" style="white-space: nowrap;">void *</var>,
<var class="Fa" style="white-space: nowrap;">sctplsinfo_t *</var>);</p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The DTrace <code class="Nm">sctp</code> provider allows users to
trace events in the <a class="Xr">sctp(4)</a> protocol implementation. This
provider is similar to the <a class="Xr">dtrace_ip(4)</a> and
<a class="Xr">dtrace_udp(4)</a> providers, but additionally contains probes
corresponding to protocol events at a level higher than packet reception and
transmission.</p>
<p class="Pp" id="sctp:cwnd::">The
<a class="permalink" href="#sctp:cwnd::"><code class="Fn">sctp:cwnd::</code></a>()
probes track changes in the congestion window on a netp. The
<a class="permalink" href="#sctp:rwnd::"><code class="Fn" id="sctp:rwnd::">sctp:rwnd::</code></a>()
probes track changes in the receiver window for an assoc. The
<a class="permalink" href="#sctp:flightsize:net:val"><code class="Fn" id="sctp:flightsize:net:val">sctp:flightsize:net:val</code></a>()
probe tracks changes in the flight size on a net or assoc and the
<a class="permalink" href="#sctp:flightsize:assoc:val"><code class="Fn" id="sctp:flightsize:assoc:val">sctp:flightsize:assoc:val</code></a>()
probe provides the total flight version.</p>
<p class="Pp" id="sctp:cwnd::rtt*">The arguments of all
<code class="Nm">sctp</code> probes except for
<a class="permalink" href="#sctp:cwnd::rtt*"><code class="Fn">sctp:cwnd::rtt*</code></a>()
and
<a class="permalink" href="#sctp::assoc:val"><code class="Fn" id="sctp::assoc:val">sctp::assoc:val</code></a>()
are the Vtag for this end, the port number of the local side, the pointer to
<code class="Dv">struct sctp_nets *changing</code>, the old value of the
cwnd, and the new value of the cwnd.</p>
<p class="Pp" id="sctp:::val">The arguments of
<a class="permalink" href="#sctp:::val"><code class="Fn">sctp:::val</code></a>()
are similar to the above except the fourth argument is the up/down
amount.</p>
<p class="Pp" id="sctp:cwnd::rtt*~2">The
<a class="permalink" href="#sctp:cwnd::rtt*~2"><code class="Fn">sctp:cwnd::rtt*</code></a>()
probe arguments are a bitmap of <code class="Dv">Vtag << 32</code> |
<code class="Dv">localport << 16</code> |
<code class="Dv">remoteport</code>, a bitmap of <code class="Dv">obw</code>
| <code class="Dv">nbw</code>, a bitmap of <code class="Dv">bwrtt</code> |
<code class="Dv">newrtt</code>, <code class="Dv">flight</code>, and a bitmap
of <code class="Dv">(cwnd << 32)</code> | <code class="Dv">point
<< 16</code> | <code class="Dv">retval(0/1)</code>.</p>
<p class="Pp" id="sctp:cwnd::init">The
<a class="permalink" href="#sctp:cwnd::init"><code class="Fn">sctp:cwnd::init</code></a>()
probe fires when a remotely-initiated active SCTP open succeeds. At this
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.</p>
<p class="Pp" id="sctp:::send">The
<a class="permalink" href="#sctp:::send"><code class="Fn">sctp:::send</code></a>()
and
<a class="permalink" href="#sctp:::receive"><code class="Fn" id="sctp:::receive">sctp:::receive</code></a>()
probes fire when the host sends or receives an SCTP packet, respectively. As
with the <a class="Xr">dtrace_udp(4)</a> provider,
<code class="Nm">sctp</code> probes fire only for packets sent by or to the
local host; forwarded packets are handled in the IP layer and are only
visible to the <a class="Xr">dtrace_ip(4)</a> provider.</p>
<p class="Pp" id="sctp:::state-change">The
<a class="permalink" href="#sctp:::state-change"><code class="Fn">sctp:::state-change</code></a>()
probe fires upon local SCTP association state transitions. Its first, third
and fifth arguments are currently always <code class="Dv">NULL</code>. Its
last argument describes the from-state in the transition, and the to-state
can be obtained from <code class="Dv">args[3]->sctps_state</code>.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1>
<dl class="Bl-tag Bl-compact">
<dt><span class="Pa">/usr/lib/dtrace/sctp.d</span></dt>
<dd>DTrace type and translator definitions for the
<code class="Nm">sctp</code> provider.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
<p class="Pp">A script that logs SCTP packets in real time:</p>
<div class="Bd Pp Bd-indent Li">
<pre>#pragma D option quiet
#pragma D option switchrate=10hz
dtrace:::BEGIN
{
printf(" %3s %15s:%-5s %15s:%-5s\n", "CPU",
"LADDR", "LPORT", "RADDR", "RPORT");
}
sctp:::send
{
printf(" %3d %16s:%-5d -> %16s:%-5d\n", cpu,
args[2]->ip_saddr, args[4]->sctp_sport,
args[2]->ip_daddr, args[4]->sctp_dport);
}
sctp:::receive
{
printf(" %3d %16s:%-5d <- %16s:%-5d\n", cpu,
args[2]->ip_daddr, args[4]->sctp_dport,
args[2]->ip_saddr, args[4]->sctp_sport);
}</pre>
</div>
A script that logs SCTP association state changes as they occur:
<div class="Bd Pp Bd-indent Li">
<pre>#pragma D option quiet
#pragma D option switchrate=10
int last[int];
dtrace:::BEGIN
{
printf(" %3s %12s %-25s %-25s\n",
"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 -> %-25s\n", 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 -> %-25s\n", cpu, "-",
sctp_state_string[args[5]->sctps_state],
sctp_state_string[args[3]->sctps_state]);
last[args[1]->cs_cid] = timestamp;
}</pre>
</div>
</section>
<section class="Sh">
<h1 class="Sh" id="COMPATIBILITY"><a class="permalink" href="#COMPATIBILITY">COMPATIBILITY</a></h1>
<p class="Pp">The <code class="Fn">sctp:::send</code>(),
<code class="Fn">sctp:::receive</code>(), and
<code class="Fn">sctp:::state-change</code>() probes are compatible with the
<code class="Nm">sctp</code> provider in Solaris. All other probes are only
available in FreeBSD.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<p class="Pp"><a class="Xr">dtrace(1)</a>, <a class="Xr">dtrace_ip(4)</a>,
<a class="Xr">dtrace_udp(4)</a>, <a class="Xr">dtrace_udplite(4)</a>,
<a class="Xr">sctp(4)</a>, <a class="Xr">SDT(9)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
<p class="Pp">This manual page was written by <span class="An">Devin
Teske</span>
<<a class="Mt" href="mailto:dteske@FreeBSD.org">dteske@FreeBSD.org</a>>.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">June 29, 2023</td>
<td class="foot-os">FreeBSD 15.0</td>
</tr>
</table>
|