xref: /freebsd/share/man/man4/netdump.4 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1e5054602SMark Johnston.\"-
2e5054602SMark Johnston.\" Copyright (c) 2018 Mark Johnston <markj@FreeBSD.org>
3e5054602SMark Johnston.\"
4e5054602SMark Johnston.\" Redistribution and use in source and binary forms, with or without
5e5054602SMark Johnston.\" modification, are permitted provided that the following conditions
6e5054602SMark Johnston.\" are met:
7e5054602SMark Johnston.\" 1. Redistributions of source code must retain the above copyright
8e5054602SMark Johnston.\"    notice, this list of conditions and the following disclaimer.
9e5054602SMark Johnston.\" 2. Redistributions in binary form must reproduce the above copyright
10e5054602SMark Johnston.\"    notice, this list of conditions and the following disclaimer in the
11e5054602SMark Johnston.\"    documentation and/or other materials provided with the distribution.
12e5054602SMark Johnston.\"
13e5054602SMark Johnston.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14e5054602SMark Johnston.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15e5054602SMark Johnston.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16e5054602SMark Johnston.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17e5054602SMark Johnston.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18e5054602SMark Johnston.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19e5054602SMark Johnston.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20e5054602SMark Johnston.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21e5054602SMark Johnston.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22e5054602SMark Johnston.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23e5054602SMark Johnston.\" SUCH DAMAGE.
24e5054602SMark Johnston.\"
25*b0832b50SMitchell Horne.Dd November 10, 2022
26e5054602SMark Johnston.Dt NETDUMP 4
27e5054602SMark Johnston.Os
28e5054602SMark Johnston.Sh NAME
29e5054602SMark Johnston.Nm netdump
30e5054602SMark Johnston.Nd protocol for transmitting kernel dumps to a remote server
31e5054602SMark Johnston.Sh SYNOPSIS
32*b0832b50SMitchell HorneTo compile netdump client support into the kernel, place the following lines in
33e5054602SMark Johnstonyour kernel configuration file:
34e5054602SMark Johnston.Bd -ragged -offset indent
35*b0832b50SMitchell Horne.Cd "options INET"
36*b0832b50SMitchell Horne.Cd "options DEBUGNET"
37e5054602SMark Johnston.Cd "options NETDUMP"
38e5054602SMark Johnston.Ed
39e5054602SMark Johnston.Sh DESCRIPTION
40e5054602SMark Johnstonnetdump is a UDP-based protocol for transmitting kernel dumps to a remote host.
41e5054602SMark JohnstonA netdump client is a panicking kernel, and a netdump server is a host
42e5054602SMark Johnstonrunning the
43e5054602SMark Johnston.Nm
44e5054602SMark Johnstondaemon, available in ports as
45e5054602SMark Johnston.Pa ports/ftp/netdumpd .
46e5054602SMark Johnston.Nm
47e5054602SMark Johnstonclients are configured using the
48e5054602SMark Johnston.Xr dumpon 8
498270d35eSConrad Meyerutility or the
508270d35eSConrad Meyer.Ic netdump
518270d35eSConrad Meyercommand in
528270d35eSConrad Meyer.Xr ddb 4 .
53e5054602SMark Johnston.Pp
54e5054602SMark Johnston.Nm
55e5054602SMark Johnstonclient messages consist of a fixed-size header followed by a variable-sized
56e5054602SMark Johnstonpayload.
57e5054602SMark JohnstonThe header contains the message type, a sequence number, the offset of
58e5054602SMark Johnstonthe payload data in the kernel dump, and the length of the payload data
59e5054602SMark Johnston(not including the header).
60e5054602SMark JohnstonThe message types are
61e5054602SMark Johnston.Dv HERALD , FINISHED , KDH , VMCORE ,
62e5054602SMark Johnstonand
63e5054602SMark Johnston.Dv EKCD_KEY .
64e5054602SMark Johnston.Nm
65e5054602SMark Johnstonserver messages have a fixed size and contain only the sequence number of
66e5054602SMark Johnstonthe client message.
67e5054602SMark JohnstonThese messages indicate that the server has successfully processed the
68e5054602SMark Johnstonclient message with the corresponding sequence number.
69e5054602SMark JohnstonAll client messages are acknowledged this way.
70e5054602SMark JohnstonServer messages are always sent to port 20024 of the client.
71e5054602SMark Johnston.Pp
72e5054602SMark JohnstonTo initiate a
73e5054602SMark Johnston.Nm ,
74e5054602SMark Johnstonthe client sends a
75e5054602SMark Johnston.Dv HERALD
76e5054602SMark Johnstonmessage to the server at port 20023.
77e5054602SMark JohnstonThe client may include a relative path in its payload, in which case the
78e5054602SMark Johnston.Nm
79e5054602SMark Johnstonserver should attempt to save the dump at that path relative to its configured
80e5054602SMark Johnstondump directory.
81e5054602SMark JohnstonThe server will acknowledge the
82e5054602SMark Johnston.Dv HERALD
83e5054602SMark Johnstonusing a random source port, and the client must send all subsequent messages
84e5054602SMark Johnstonto that port.
85e5054602SMark Johnston.Pp
86e5054602SMark JohnstonThe
87e5054602SMark Johnston.Dv KDH , VMCORE ,
88e5054602SMark Johnstonand
89e5054602SMark Johnston.Dv EKCD_KEY
90e5054602SMark Johnstonmessage payloads contain the kernel dump header, dump contents, and
91e5054602SMark Johnstondump encryption key respectively.
92e5054602SMark JohnstonThe offset in the message header should be treated as a seek offset
93e5054602SMark Johnstonin the corresponding file.
94e5054602SMark JohnstonThere are no ordering requirements for these messages.
95e5054602SMark Johnston.Pp
96e5054602SMark JohnstonA
97e5054602SMark Johnston.Nm
98e5054602SMark Johnstonis completed by sending the
99e5054602SMark Johnston.Dv FINISHED
100e5054602SMark Johnstonmessage to the server.
101e5054602SMark Johnston.Pp
102e5054602SMark JohnstonThe following network drivers support netdump:
103e5054602SMark Johnston.Xr alc 4 ,
104e5054602SMark Johnston.Xr bge 4 ,
105550c8fa1SMark Johnston.Xr bnxt 4 ,
106e5054602SMark Johnston.Xr bxe 4 ,
107e5054602SMark Johnston.Xr cxgb 4 ,
108e5054602SMark Johnston.Xr em 4 ,
109e5054602SMark Johnston.Xr igb 4 ,
110e5054602SMark Johnston.Xr ix 4 ,
1115e97950dSMark Johnston.Xr ixl 4 ,
112fd6c1171SMark Johnston.Xr mlx4en 4 ,
113d141d1ccSHans Petter Selasky.Xr mlx5en 4 ,
114e5054602SMark Johnston.Xr re 4 ,
115e5054602SMark Johnston.Xr vtnet 4 .
11693b1fe0eSMark Johnston.Sh SYSCTL VARIABLES
11793b1fe0eSMark JohnstonThe following variables are available as both
11893b1fe0eSMark Johnston.Xr sysctl 8
11993b1fe0eSMark Johnstonvariables and
12093b1fe0eSMark Johnston.Xr loader 8
12193b1fe0eSMark Johnstonvariables:
12293b1fe0eSMark Johnston.Bl -tag -width "indent"
12393b1fe0eSMark Johnston.It Va net.netdump.debug
12493b1fe0eSMark JohnstonControl debug message verbosity.
12593b1fe0eSMark JohnstonDebug messages are disabled by default, but are useful when troubleshooting
12693b1fe0eSMark Johnstonor when developing driver support.
12793b1fe0eSMark Johnston.It Va net.netdump.path
12893b1fe0eSMark JohnstonSpecify a path relative to the server's dump directory in which to store
12993b1fe0eSMark Johnstonthe dump.
13093b1fe0eSMark JohnstonFor example, if the
13193b1fe0eSMark Johnston.Nm
13293b1fe0eSMark Johnstonserver is configured to store dumps in
13393b1fe0eSMark Johnston.Pa /var/crash ,
13493b1fe0eSMark Johnstona path of
13593b1fe0eSMark Johnston.Dq foo
13693b1fe0eSMark Johnstonwill cause the server to attempt to store dumps from the client in
13793b1fe0eSMark Johnston.Pa /var/crash/foo .
13893b1fe0eSMark JohnstonThe server will not automatically create the relative directory.
139da7d7778SMark Johnston.It Va net.netdump.polls
140da7d7778SMark JohnstonThe client will poll the configured network interface while waiting for
141da7d7778SMark Johnstonacknowledgements.
142da7d7778SMark JohnstonThis parameter controls the maximum number of poll attempts before giving
143da7d7778SMark Johnstonup, which typically results in a re-transmit.
144da7d7778SMark JohnstonEach poll attempt takes 0.5ms.
145da7d7778SMark Johnston.It Va net.netdump.retries
146da7d7778SMark JohnstonThe number of times the client will re-transmit a packet before aborting
147da7d7778SMark Johnstona dump due to a lack of acknowledgement.
148da7d7778SMark JohnstonThe default may be too small in environments with lots of packet loss.
149da7d7778SMark Johnston.It Va net.netdump.arp_retries
150da7d7778SMark JohnstonThe number of times the client will attempt to learn the MAC address of
151da7d7778SMark Johnstonthe configured gateway or server before giving up and aborting the dump.
15293b1fe0eSMark Johnston.El
153e5054602SMark Johnston.Sh SEE ALSO
154e5054602SMark Johnston.Xr decryptcore 8 ,
155e5054602SMark Johnston.Xr dumpon 8 ,
156e5054602SMark Johnston.Xr savecore 8
157e5054602SMark Johnston.Sh HISTORY
158e5054602SMark Johnston.Nm
159e5054602SMark Johnstonclient support first appeared in
160e5054602SMark Johnston.Fx 12.0 .
161e5054602SMark Johnston.Sh BUGS
162e5054602SMark JohnstonOnly IPv4 is supported.
163e5054602SMark Johnston.Pp
164e5054602SMark Johnston.Nm
165e5054602SMark Johnstonmay only be used after the kernel has panicked.
166