chiark / gitweb /
pathmtu/pathmtu.c: Document the `--verbose' option.
[tripe] / pathmtu / pathmtu.1.in
1 .\" -*-nroff-*-
2 .\"
3 .\" Documentation for pathmtu
4 .\"
5 .\" (c) 2008 Straylight/Edgeware.
6 .\"
7 .
8 .\"----- Licensing notice ---------------------------------------------------
9 .\"
10 .\" This file is part of Trivial IP Encryption (TrIPE).
11 .\"
12 .\" TrIPE is free software: you can redistribute it and/or modify it under
13 .\" the terms of the GNU General Public License as published by the Free
14 .\" Software Foundation; either version 3 of the License, or (at your
15 .\" option) any later version.
16 .\"
17 .\" TrIPE is distributed in the hope that it will be useful, but WITHOUT
18 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
20 .\" for more details.
21 .\"
22 .\" You should have received a copy of the GNU General Public License
23 .\" along with TrIPE.  If not, see <https://www.gnu.org/licenses/>.
24 .
25 .\"--------------------------------------------------------------------------
26 .so ../common/defs.man \" @@@PRE@@@
27 .
28 .\"--------------------------------------------------------------------------
29 .TH pathmtu 1 "29 December 2008" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption"
30 .
31 .\"--------------------------------------------------------------------------
32 .SH "NAME"
33 .
34 pathmtu \- discover path MTU to a given host
35 .
36 .\"--------------------------------------------------------------------------
37 .SH "SYNOPSIS"
38 .
39 .B pathmtu
40 .RB [ \-v ]
41 .RB [ \-H
42 .IR header ]
43 .RB [ \-m
44 .IR method ]
45 .br
46         \c
47 .RB [ \-r
48 .IR retransmit ]
49 .RB [ \-g
50 .IR factor ]
51 .RB [ \-t
52 .IR timeout ]
53 .br
54         \c
55 .I host
56 .RI [ port ]
57 .
58 .\"--------------------------------------------------------------------------
59 .SH "DESCRIPTION"
60 .
61 The
62 .B pathmtu
63 program discovers the size of the largest IP packet which can be sent to
64 a given
65 .I host
66 (specified as a dotted-quad IP address or host name) without being
67 fragmented.  This is useful information, particularly when setting up
68 VPN tunnel interfaces.
69 .PP
70 The program works by sending UDP packets and finding out whether they
71 get fragmented.  The packets are sent to a specified
72 .I port
73 (specified as a number or service name) on the destination host.  The
74 destination does not need to be listening on the given port \(en indeed,
75 it doesn't matter if the port is firewalled.  The default port is 7
76 (echo), chosen because if it is active, we'll get an answer.
77 .PP
78 The
79 .B pathmtu
80 program attempts to find a correct answer even if ICMP
81 fragmentation-required packets are suppressed.  It distinguishes between
82 the remote host dropping packets and an intermediate router failing to
83 report fragmentation-needed errors by sending a minimum-size packet and
84 seeing whether it gets any response to that.
85 .PP
86 The
87 .B pathmtu
88 program (currently) contains two different methods for MTU probing.  One
89 uses the Linux-specific
90 .B IP_MTU
91 and
92 .B IP_MTU_DISCOVER
93 socket options; this works fine even as an unprivileged user.  The other
94 uses raw sockets, so it's fairly portable, but
95 .B pathmtu
96 must be installed setuid-root to work.  (It attempts to create its raw
97 sockets as its first action \(en before processing the command line \(en
98 and drops privileges immediately afterwards, so the attack surface is
99 very tiny.)  The raw sockets method is very slightly more robust:
100 specifically, it's much less likely to get confused by delayed errors.
101 .PP
102 Command-line options are as follows.
103 .TP
104 .B "\-h, \-\-help"
105 Writes a brief description of the command-line options available to
106 standard output and exits with status 0.
107 .TP
108 .B "\-V, \-\-version"
109 Writes tripe's version number to standard output and exits with status
110 0.
111 .TP
112 .B "\-u, \-\-usage"
113 Writes a brief usage summary to standard output and exits with status 0.
114 .TP
115 .BI "\-g, \-\-growth=" factor
116 Sets the retransmit interval growth factor.  Each time a packet is
117 retransmitted,
118 .B pathmtu
119 increases the amount of time it waits before retransmitting again by
120 this
121 .IR factor .
122 The default growth factor is 3.
123 .TP
124 .BI "\-m, \-\-method=" name
125 Select the MTU probing method.  The available methods are shown by
126 .BR \-\-help .
127 The
128 .B linux
129 method is Linux-specific and might be confused by delayed errors under
130 some circumstances, but it's usable by unprivileged users; the
131 .B raw
132 method is portable but requires
133 .B pathmtu
134 to be installed setuid-root.
135 .TP
136 .BI "\-r, \-\-retransmit=" interval
137 Sets the initial retransmit interval, in seconds.  If no reply is
138 received to a probe within the interval, then a second packet is sent,
139 and the retransmit interval increased by the growth factor (see
140 .BR \-g ).
141 The default initial retransmit interval is 0.333 seconds.
142 .TP
143 .BI "\-t, \-\-timeout=" timeout
144 Sets the time to wait for a reply, in seconds.  If no reply or error is
145 received within the timeout, it is assumed that no reply will be
146 forthcoming.  If we've ever received a reply from the remote host in the
147 past, then
148 .B pathmtu
149 assumes that a timeout indicates that the packet was too large, but the
150 ICMP fragmentation-required error was suppressed as a result of
151 administrative incompetence by someone responsible for an intermediate
152 router.  Otherwise,
153 .B pathmtu
154 sends a small packet to settle the question of where packets are being
155 dropped: if it doesn't receive a response to this packet either, then it
156 assumes that the timeout means that the remote host
157 .I did
158 receive the packet.  The default timeout is 8 seconds.
159 .TP
160 .B "\-v, \-\-verbose"
161 Write a running human-readable commentary to standard error about the
162 progress of the operation.  Usually,
163 .B pathmtu
164 does its job silently unless there are errors.
165 .TP
166 .BI "\-H, \-\-header=" header
167 Sets the packet header, in hexadecimal.  If you set an explicit port
168 number, it may be worth setting the packet header too, so as not to
169 alarm anything which might be listening on that port.  A sequence number
170 (in order to disambiguate replies) and some pseudorandom data are
171 appended to the header.  The default header is empty.
172 .
173 .\"--------------------------------------------------------------------------
174 .SH "BUGS"
175 .
176 The whole business of probing path MTUs is rather unpleasant.
177 .
178 .\"--------------------------------------------------------------------------
179 .SH "AUTHOR"
180 .
181 Mark Wooding, <mdw@distorted.org.uk>
182 .
183 .\"----- That's all, folks --------------------------------------------------